Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/ForLoopIndex.cs @ 15189

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

#2665 Fixed Benchmark Problem Definition, Converted LoopExpressions to stateless expressions, Added several unit test to ensure funcionality, Fixed UI bugs

File size: 1.7 KB
Line 
1namespace HeuristicLab.BenchmarkSuite.Problems {
2  public class ForLoopIndex : BenchmarkSuiteDataDescriptor {
3    private const string name = "For Loop Index - Hard";
4    private const string fileName = "ForLoopIndex.csv";
5    private const string description = "Given 3 integer inputs start,end, and step, print the integers in the sequence n|0 = start, n|i = n|i−1 + step for each n|i < end, each on their own line.";
6
7    protected override string FileName { get { return fileName; } }
8
9    public override string Name { get { return name; } }
10
11    public override string Description { get { return description; } }
12
13    protected override int InputArgumentCount { get { return 3; } }
14
15    protected override int OutputArgumentCount { get { return 1; } }
16
17    public override ProblemData CreateProblemData() {
18      return new ProblemData(ProblemType.ForLoopIndex) {
19        Name = Name,
20        Description = Description,
21        Examples = CloneExamples(),
22        BestResult = 0,
23        WorstResult = 1000,
24        InputArgumentTypes = new[] { ExampleArgumentType.Integer, ExampleArgumentType.Integer, ExampleArgumentType.Integer },
25        OutputArgumentTypes = new[] { ExampleArgumentType.Print },
26        TrainingCount = 100,
27        TestCount = 1000,
28        EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.String | DataTypes.Print,
29        MaxSize = 300,
30        EvalLimit = 600,
31      };
32    }
33
34    protected override Example ParseExample(string[] input, string[] output) {
35      return new Example {
36        InputArgs = input,
37        OutputArgs = output,
38        InputInteger = ExampleArgumentConverter.ConvertIntegers(input),
39        OutputPrint = output[0]
40      };
41    }
42  }
43}
Note: See TracBrowser for help on using the repository browser.