[14875] | 1 | namespace HeuristicLab.BenchmarkSuite.Problems {
|
---|
[14897] | 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 |
|
---|
[14875] | 6 | public class SuperAnagrams : BenchmarkSuiteDataDescriptor {
|
---|
[14952] | 7 | private const string name = "Super Anagrams - Hard";
|
---|
[14875] | 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() {
|
---|
[15017] | 18 | return new ProblemData(ProblemType.SuperAnagrams) {
|
---|
[14875] | 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,
|
---|
[14897] | 33 | BooleanErcOptions = new BooleanErcOptions(
|
---|
[14952] | 34 | new BooleanRandomErc {
|
---|
[14897] | 35 | IsEnabled = true,
|
---|
| 36 | AllowFalse = true,
|
---|
| 37 | AllowTrue = true
|
---|
| 38 | }),
|
---|
| 39 | IntegerErcOptions = new IntegerErcOptions(
|
---|
[14952] | 40 | new IntegerRangeErc(-1000, 1000)),
|
---|
[14897] | 41 | CharErcOptions = new CharErcOptions(
|
---|
[14952] | 42 | new IntegerRangeErc(0x20, 0x7e))
|
---|
[14875] | 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 | }
|
---|