1 | namespace HeuristicLab.BenchmarkSuite.Problems {
|
---|
2 | using HeuristicLab.Problems.ProgramSynthesis.Base.Erc;
|
---|
3 |
|
---|
4 | public class StringDifferences : BenchmarkSuiteDataDescriptor {
|
---|
5 | private const string name = "String Differences";
|
---|
6 | private const string fileName = "StringDifferences.csv";
|
---|
7 | private const string description = "Given 2 strings (without whitespace) as input, find the indices at which the strings have different characters, stopping at the end of the shorter one.For each such index, print a line containing the index as well as the character in each string. For example, if the strings are “dealer” and “dollars”, the program should print: 1 e o, 2 a l, 4 e a";
|
---|
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 {
|
---|
17 | Name = Name,
|
---|
18 | Description = Description,
|
---|
19 | Examples = CloneExamples(),
|
---|
20 | BestResult = 0,
|
---|
21 | WorstResult = 100,
|
---|
22 | InputArgumentTypes = new[] { ExampleArgumentType.String, ExampleArgumentType.String },
|
---|
23 | OutputArgumentTypes = new[] { ExampleArgumentType.String },
|
---|
24 | TrainingCount = 200,
|
---|
25 | TestCount = 2000,
|
---|
26 | EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.Char | DataTypes.String,
|
---|
27 | MaxSize = 1000,
|
---|
28 | EvalLimit = 2000,
|
---|
29 | ErcOptions = {
|
---|
30 | ErcProbability = 0.05,
|
---|
31 | CharErcOptions = {
|
---|
32 | IsEnabled = true,
|
---|
33 | Constants = new [] { ' ', '\r' },
|
---|
34 | },
|
---|
35 | IntegerErcOptions = {
|
---|
36 | IsEnabled = true,
|
---|
37 | Start = -10,
|
---|
38 | End = 10
|
---|
39 | }
|
---|
40 | }
|
---|
41 | };
|
---|
42 | }
|
---|
43 |
|
---|
44 | protected override Example ParseExample(string[] input, string[] output) {
|
---|
45 | return new Example {
|
---|
46 | InputArgs = input,
|
---|
47 | OutputArgs = output,
|
---|
48 | InputString = input,
|
---|
49 | OutputString = output,
|
---|
50 | };
|
---|
51 | }
|
---|
52 | }
|
---|
53 | }
|
---|