1 | namespace 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 - Hard";
|
---|
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(ProblemType.SuperAnagrams) {
|
---|
19 | Name = Name,
|
---|
20 | Description = Description,
|
---|
21 | ProgramExecutionBudget = 60000000,
|
---|
22 | Examples = CloneExamples(),
|
---|
23 | BestResult = 0,
|
---|
24 | WorstResult = 1,
|
---|
25 | InputArgumentTypes = new[] { ExampleArgumentType.String, ExampleArgumentType.String },
|
---|
26 | OutputArgumentTypes = new[] { ExampleArgumentType.Boolean },
|
---|
27 | TrainingCount = 200,
|
---|
28 | TestCount = 2000,
|
---|
29 | EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String,
|
---|
30 | MaxSize = 800,
|
---|
31 | EvalLimit = 1600,
|
---|
32 | ErcOptions = {
|
---|
33 | ErcProbability = 0.05,
|
---|
34 | BooleanErcOptions = new BooleanErcOptions(
|
---|
35 | new BooleanRandomErc {
|
---|
36 | IsEnabled = true,
|
---|
37 | AllowFalse = true,
|
---|
38 | AllowTrue = true
|
---|
39 | }),
|
---|
40 | IntegerErcOptions = new IntegerErcOptions(
|
---|
41 | new IntegerRangeErc(-1000, 1000)),
|
---|
42 | CharErcOptions = new CharErcOptions(
|
---|
43 | new IntegerRangeErc(0x20, 0x7e))
|
---|
44 | }
|
---|
45 | };
|
---|
46 | }
|
---|
47 |
|
---|
48 | protected override Example ParseExample(string[] input, string[] output) {
|
---|
49 | return new Example {
|
---|
50 | InputArgs = input,
|
---|
51 | OutputArgs = output,
|
---|
52 | InputString = input,
|
---|
53 | OutputBoolean = ExampleArgumentConverter.ConvertBooleans(output[0]),
|
---|
54 | };
|
---|
55 | }
|
---|
56 | }
|
---|
57 | }
|
---|