Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/Digits.cs @ 15334

Last change on this file since 15334 was 15334, checked in by pkimmesw, 7 years ago

#2665 Testet Problems, Testet error functions, Small fixes, Created HL files

File size: 2.1 KB
Line 
1namespace HeuristicLab.BenchmarkSuite.Problems {
2  using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Char;
3  using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Integer;
4
5  public class Digits : BenchmarkSuiteDataDescriptor {
6    private const string name = "Digits - Hard";
7    private const string fileName = "Digits.csv";
8    private const string description = "Given an integer, print that integer’s digits each on their own line starting with the least significant digit.A negative integer should have the negative sign printed before the most significant digit.";
9
10    protected override string FileName { get { return fileName; } }
11    public override string Name { get { return name; } }
12    public override string Description { get { return description; } }
13    protected override int InputArgumentCount { get { return 1; } }
14    protected override int OutputArgumentCount { get { return 1; } }
15
16    public override ProblemData CreateProblemData() {
17      return new ProblemData(ProblemType.Digits) {
18        Name = Name,
19        Description = Description,
20        ProgramExecutionBudget = 30000000,
21        Examples = CloneExamples(),
22        BestResult = 0,
23        WorstResult = 5000,
24        InputArgumentTypes = new[] { ExampleArgumentType.Integer },
25        OutputArgumentTypes = new[] { ExampleArgumentType.Print },
26        TrainingCount = 100,
27        TestCount = 1000,
28        EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String | DataTypes.Print,
29        MaxSize = 300,
30        EvalLimit = 600,
31        ErcOptions = {
32          ErcProbability = 0.05,
33          IntegerErcOptions = new IntegerErcOptions(
34            new IntegerRangeErc(-10, 10)),
35          CharErcOptions = new CharErcOptions(
36            new IntegerConstantErc('\n'))
37        }
38      };
39    }
40
41    protected override Example ParseExample(string[] input, string[] output) {
42      return new Example {
43        InputArgs = input,
44        OutputArgs = output,
45        InputInteger = ExampleArgumentConverter.ConvertIntegers(input[0]),
46        OutputPrint = output[0],
47      };
48    }
49  }
50}
Note: See TracBrowser for help on using the repository browser.