Free cookie consent management tool by TermsFeed Policy Generator

source: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/SuperAnagrams.cs @ 14897

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

#2665 Dynamic ErcValues, Separate Push from BenchmarkSuite Push

File size: 2.4 KB
Line 
1namespace HeuristicLab.BenchmarkSuite.Problems {
2  using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Boolean;
3  using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Char;
4  using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Integer;
5
6  public class SuperAnagrams : BenchmarkSuiteDataDescriptor {
7    private const string name = "Super Anagrams";
8    private const string fileName = "SuperAnagrams.csv";
9    private const string description = "Given strings x and y of lowercase letters, return true if y is a super anagram of x, which is the case if every character in x is in y.To be true, y may contain extra characters, but must have at least as many copies of each character as x does.";
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 2; } }
15    protected override int OutputArgumentCount { get { return 1; } }
16
17    public override ProblemData CreateProblemData() {
18      return new ProblemData {
19        Name = Name,
20        Description = Description,
21        Examples = CloneExamples(),
22        BestResult = 0,
23        WorstResult = 1,
24        InputArgumentTypes = new[] { ExampleArgumentType.String, ExampleArgumentType.String },
25        OutputArgumentTypes = new[] { ExampleArgumentType.Boolean },
26        TrainingCount = 200,
27        TestCount = 2000,
28        EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String,
29        MaxSize = 800,
30        EvalLimit = 1600,
31        ErcOptions = {
32          ErcProbability = 0.05,
33          BooleanErcOptions = new BooleanErcOptions(
34            new BooleanRandomErcValue {
35              IsEnabled = true,
36              AllowFalse = true,
37              AllowTrue = true
38            }),
39          IntegerErcOptions = new IntegerErcOptions(
40            new IntegerRangeErcValue(-1000, 1000)),
41          CharErcOptions = new CharErcOptions(
42            new IntegerRangeErcValue(0x20, 0x7e))
43        }
44      };
45    }
46
47    protected override Example ParseExample(string[] input, string[] output) {
48      return new Example {
49        InputArgs = input,
50        OutputArgs = output,
51        InputString = input,
52        OutputBoolean = ExampleArgumentConverter.ConvertBooleans(output[0]),
53      };
54    }
55  }
56}
Note: See TracBrowser for help on using the repository browser.