Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/Checksum.cs @ 15341

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

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

File size: 2.5 KB
Line 
1namespace HeuristicLab.BenchmarkSuite.Problems {
2  using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Char;
3  using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Integer;
4  using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.String;
5
6  public class Checksum : BenchmarkSuiteDataDescriptor {
7    private const string name = "Checksum - Hard";
8    private const string fileName = "Checksum.csv";
9    private const string description = "Given a string, convert each character in the string into its integer ASCII value, sum them, take the sum modulo 64, add the integer value of the space character, and then convert that integer back into its corresponding character(the checksum character). The program must print Check sum is X, where X is replaced by the correct checksum character.";
10
11    protected override string FileName { get { return fileName; } }
12    public override string Name { get { return name; } }
13    public override string Description { get { return description; } }
14    protected override int InputArgumentCount { get { return 1; } }
15    protected override int OutputArgumentCount { get { return 1; } }
16
17    public override ProblemData CreateProblemData() {
18      return new ProblemData(ProblemType.Checksum) {
19        Name = Name,
20        Description = Description,
21        ProgramExecutionBudget = 30000000,
22        Examples = CloneExamples(),
23        BestResult = 0,
24        WorstResult = 1000,
25        InputArgumentTypes = new[] { ExampleArgumentType.String },
26        OutputArgumentTypes = new[] { ExampleArgumentType.Print },
27        TrainingCount = 100,
28        TestCount = 1000,
29        EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String | DataTypes.Print,
30        MaxSize = 800,
31        EvalLimit = 1500,
32        ErcOptions = {
33          ErcProbability = 0.05,
34          IntegerErcOptions = new IntegerErcOptions(
35            new IntegerConstantErc(64),
36            new IntegerRangeErc(-128, 128)),
37          CharErcOptions = new CharErcOptions(
38            new IntegerConstantErc(' '),
39            new IntegerRangeErc(0x20, 0x7e)),
40          StringErcOptions = new StringErcOptions(
41            new StringConstantErc("Check sum is "))
42        }
43      };
44    }
45
46    protected override Example ParseExample(string[] input, string[] output) {
47      return new Example {
48        InputArgs = input,
49        OutputArgs = output,
50        InputString = input,
51        OutputPrint = output[0],
52      };
53    }
54  }
55}
Note: See TracBrowser for help on using the repository browser.