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 {
|
---|
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 BooleanRandomErc {
|
---|
35 | IsEnabled = true,
|
---|
36 | AllowFalse = true,
|
---|
37 | AllowTrue = true
|
---|
38 | }),
|
---|
39 | IntegerErcOptions = new IntegerErcOptions(
|
---|
40 | new IntegerRangeErc(-1000, 1000)),
|
---|
41 | CharErcOptions = new CharErcOptions(
|
---|
42 | new IntegerRangeErc(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 | }
|
---|