Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/SmallOrLarge.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.9 KB
Line 
1namespace HeuristicLab.BenchmarkSuite.Problems {
2  public class SmallOrLarge : BenchmarkSuiteDataDescriptor {
3    private const string name = "Small or Large";
4    private const string fileName = "SmallOrLarge.csv";
5    private const string description =
6      "Given an integer n, print “small” if n < 1000 and “large” if n ≥ 2000 (and nothing if 1000 ≤ n < 2000).";
7
8    protected override string FileName { get { return fileName; } }
9    public override string Name { get { return name; } }
10    public override string Description { get { return description; } }
11    protected override int InputArgumentCount { get { return 1; } }
12    protected override int OutputArgumentCount { get { return 1; } }
13
14    public override ProblemData CreateProblemData() {
15      return new ProblemData {
16        Name = Name,
17        Description = Description,
18        Examples = CloneExamples(),
19        BestResult = 0,
20        WorstResult = 5,
21        InputArgumentTypes = new[] { ExampleArgumentType.Integer },
22        OutputArgumentTypes = new[] { ExampleArgumentType.String },
23        TrainingCount = 100,
24        TestCount = 1000,
25        EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.String,
26        MaxSize = 200,
27        EvalLimit = 300,
28        ErcOptions = {
29          ErcProbability = 0.05,
30          IntegerErcOptions = {
31            IsEnabled = true,
32            Start = -10000,
33            End = 10000
34          },
35          StringErcOptions = {
36            IsEnabled = true,
37            Constants = new [] { "small", "large" }
38          }
39        }
40      };
41    }
42
43    protected override Example ParseExample(string[] input, string[] output) {
44      return new Example {
45        InputArgs = input,
46        OutputArgs = output,
47        InputInteger = ExampleArgumentConverter.ConvertIntegers(input[0]),
48        OutputString = output
49      };
50    }
51  }
52}
Note: See TracBrowser for help on using the repository browser.