Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/SumOfSquares.cs @ 14875

Last change on this file since 14875 was 14875, checked in by pkimmesw, 8 years ago

#2665 BenchmarkSuite, all examples, partially tested, VectorExpressions added

File size: 1.8 KB
Line 
1namespace HeuristicLab.BenchmarkSuite.Problems {
2  public class SumOfSquares : BenchmarkSuiteDataDescriptor {
3    private const string name = "Sum of Squares";
4    private const string fileName = "SumOfSquares.csv";
5    private const string description = "Given integer n, return the sum of squaring each integer in the range[1, n].";
6
7    protected override string FileName { get { return fileName; } }
8    public override string Name { get { return name; } }
9    public override string Description { get { return description; } }
10    protected override int InputArgumentCount { get { return 1; } }
11    protected override int OutputArgumentCount { get { return 1; } }
12
13    public override ProblemData CreateProblemData() {
14      return new ProblemData {
15        Name = Name,
16        Description = Description,
17        Examples = CloneExamples(),
18        BestResult = 0,
19        WorstResult = 338350,
20        InputArgumentTypes = new[] { ExampleArgumentType.Integer },
21        OutputArgumentTypes = new[] { ExampleArgumentType.Integer },
22        TrainingCount = 50,
23        TestCount = 100,
24        EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean,
25        MaxSize = 400,
26        EvalLimit = 4000,
27        ErcOptions = {
28          ErcProbability = 0.05,
29          IntegerErcOptions = {
30            IsEnabled = true,
31            Start = -100,
32            End = 100
33          }
34        }
35      };
36    }
37
38    protected override Example ParseExample(string[] input, string[] output) {
39      return new Example {
40        InputArgs = input,
41        OutputArgs = output,
42        InputInteger = ExampleArgumentConverter.ConvertIntegers(input[0]),
43        OutputInteger = ExampleArgumentConverter.ConvertIntegers(output[0]),
44      };
45    }
46  }
47}
Note: See TracBrowser for help on using the repository browser.