Free cookie consent management tool by TermsFeed Policy Generator

source: branches/2895_PushGP_GenealogyAnalysis/HeuristicLab.Problems.ProgramSynthesis/Push/BenchmarkSuite/Problems/SuperAnagrams.cs @ 15771

Last change on this file since 15771 was 15771, checked in by bburlacu, 6 years ago

#2895: Add solution skeleton for PushGP with genealogy analysis.

File size: 2.3 KB
Line 
1using HeuristicLab.Problems.ProgramSynthesis;
2
3namespace HeuristicLab.BenchmarkSuite.Problems {
4  public class SuperAnagrams : BenchmarkSuiteDataDescriptor {
5    private const string name = "Super Anagrams - Hard";
6    private const string fileName = "SuperAnagrams.csv";
7    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.";
8
9    protected override string FileName { get { return fileName; } }
10    public override string Name { get { return name; } }
11    public override string Description { get { return description; } }
12    protected override int InputArgumentCount { get { return 2; } }
13    protected override int OutputArgumentCount { get { return 1; } }
14
15    public override ProblemData CreateProblemData() {
16      return new ProblemData(ProblemType.SuperAnagrams) {
17        Name = Name,
18        Description = Description,
19        ProgramExecutionBudget = 60000000,
20        Examples = CloneExamples(),
21        BestResult = 0,
22        WorstResult = 1,
23        InputArgumentTypes = new[] { ExampleArgumentType.String, ExampleArgumentType.String },
24        OutputArgumentTypes = new[] { ExampleArgumentType.Boolean },
25        TrainingCount = 200,
26        TestCount = 2000,
27        EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String,
28        MaxSize = 800,
29        EvalLimit = 1600,
30        ErcOptions = {
31          ErcProbability = 0.05,
32          BooleanErcOptions = new BooleanErcOptions(
33            new BooleanRandomErc {
34              IsEnabled = true,
35              AllowFalse = true,
36              AllowTrue = true
37            }),
38          IntegerErcOptions = new IntegerErcOptions(
39            new IntegerRangeErc(-1000, 1000)),
40          CharErcOptions = new CharErcOptions(
41            new IntegerRangeErc(0x20, 0x7e))
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        OutputBoolean = ExampleArgumentConverter.ConvertBooleans(output[0]),
52      };
53    }
54  }
55}
Note: See TracBrowser for help on using the repository browser.