Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/10/17 00:27:31 (7 years ago)
Author:
pkimmesw
Message:

#2665 LexicaseSelector, Performance improvements, UI Fixes, Debugger only shows used stacks, fixed Debugger stepping, Added vector expressions, ERCOptions,

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/BenchmarkSuiteDataDescriptor.cs

    r14777 r14834  
    66  using System.Reflection;
    77  using System.Text.RegularExpressions;
    8 
    9   using HeuristicLab.BenchmarkSuite.ERC;
    108  using HeuristicLab.BenchmarkSuite.Problems;
    119
     
    1917
    2018    private Example[] examples;
    21     public Example[] Examples
    22     {
    23       get
    24       {
    25         return this.examples ?? (this.examples = this.ParseData().ToArray());
    26       }
     19
     20    protected Example[] CloneExamples() {
     21      if (examples == null) examples = ParseData().ToArray();
     22      return examples.Select(e => (Example)e.Clone()).ToArray();
    2723    }
    2824
    29     public Data CreateProblemData() {
    30       return new Data {
    31         Name = Name,
    32         Description = Description,
    33         Examples = Examples.ToArray(),
    34         BestResult = BestResult,
    35         WorstResult = WorstResult,
    36         InputArgumentTypes = InputArgumentTypes,
    37         OutputArgumentTypes = OutputArgumentTypes,
    38         OriginalTestCount = OriginalTestCount,
    39         OriginalTrainingCount = OriginalTrainingCount,
    40         EnabledDataTypes = EnabledDataTypes,
    41         EvalLimit = EvalLimit,
    42         MaxGenerations = MaxGenerations,
    43         MaxSize = MaxSize,
    44         ProgEvalBudget = ProgEvalBudget,
    45         ProblemErcOptions = ProblemErcOptions,
    46       };
    47     }
     25    public abstract Data CreateProblemData();
    4826
     27    protected abstract string FileName { get; }
    4928    public abstract string Name { get; }
    5029    public abstract string Description { get; }
    51     protected abstract string FileName { get; }
    52     public abstract int OriginalTrainingCount { get; }
    53     public abstract int OriginalTestCount { get; }
    54     public abstract int BestResult { get; }
    55     public abstract int WorstResult { get; }
    56     public abstract ExampleArgumentType[] InputArgumentTypes { get; }
    57     public abstract ExampleArgumentType[] OutputArgumentTypes { get; }
    58     public abstract ProblemErcOptions ProblemErcOptions { get; }
    59     public abstract DataTypes EnabledDataTypes { get; }
    60     public abstract int MaxSize { get; }
    61     public abstract int EvalLimit { get; }
    62     public abstract int MaxGenerations { get; }
    63     public abstract int ProgEvalBudget { get; }
     30    protected abstract int InputArgumentCount { get; }
     31    protected abstract int OutputArgumentCount { get; }
    6432
    65     public abstract Example ParseExample(string[] input, string[] output);
     33    protected abstract Example ParseExample(string[] input, string[] output);
    6634
    6735    private IEnumerable<Example> ParseData() {
     
    7947            var fields = parser.ReadFields();
    8048
    81             if (fields.Length != InputArgumentTypes.Length + OutputArgumentTypes.Length)
     49            if (fields.Length != InputArgumentCount + OutputArgumentCount)
    8250              throw new InvalidDataException("Number of values do not fit");
    8351
    84             var input = fields.Take(InputArgumentTypes.Length).ToArray();
    85             var output = fields.Skip(OutputArgumentTypes.Length).ToArray();
     52            var input = fields.Take(InputArgumentCount).ToArray();
     53            var output = fields.Skip(InputArgumentCount).ToArray();
    8654
    8755            yield return ParseExample(input, output);
Note: See TracChangeset for help on using the changeset viewer.