1 | namespace HeuristicLab.BenchmarkSuite.Problems {
|
---|
2 |
|
---|
3 | public class MirrorImage : BenchmarkSuiteDataDescriptor {
|
---|
4 | private const string name = "Mirror Image";
|
---|
5 | private const string fileName = "MirrorImage.csv";
|
---|
6 | private const string description = "Given two vectors of integers, return true if one vector is the reverse of the other, and false otherwise.";
|
---|
7 |
|
---|
8 | protected override string FileName { get { return fileName; } }
|
---|
9 | public override string Name { get { return name; } }
|
---|
10 | public override string Description { get { return description; } }
|
---|
11 | protected override int InputArgumentCount { get { return 2; } }
|
---|
12 | protected override int OutputArgumentCount { get { return 1; } }
|
---|
13 |
|
---|
14 | public override ProblemData CreateProblemData() {
|
---|
15 | return new ProblemData {
|
---|
16 | Name = Name,
|
---|
17 | Description = Description,
|
---|
18 | Examples = CloneExamples(),
|
---|
19 | BestResult = 0,
|
---|
20 | WorstResult = 1,
|
---|
21 | InputArgumentTypes = new[] { ExampleArgumentType.IntegerVector, ExampleArgumentType.IntegerVector },
|
---|
22 | OutputArgumentTypes = new[] { ExampleArgumentType.Boolean },
|
---|
23 | TrainingCount = 100,
|
---|
24 | TestCount = 1000,
|
---|
25 | EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.IntegerVector,
|
---|
26 | MaxSize = 300,
|
---|
27 | EvalLimit = 600,
|
---|
28 | ErcOptions = {
|
---|
29 | ErcProbability = 0.05,
|
---|
30 | BooleanErcOptions = {
|
---|
31 | IsEnabled = true,
|
---|
32 | AllowFalse = true,
|
---|
33 | AllowTrue = true
|
---|
34 | }
|
---|
35 | }
|
---|
36 | };
|
---|
37 | }
|
---|
38 |
|
---|
39 | protected override Example ParseExample(string[] input, string[] output) {
|
---|
40 | return new Example {
|
---|
41 | InputArgs = input,
|
---|
42 | OutputArgs = output,
|
---|
43 | InputIntegerVector = new[] {
|
---|
44 | ExampleArgumentConverter.ConvertIntegers(input[0]),
|
---|
45 | ExampleArgumentConverter.ConvertIntegers(input[1])
|
---|
46 | },
|
---|
47 | OutputBoolean = ExampleArgumentConverter.ConvertBooleans(output[0]),
|
---|
48 | };
|
---|
49 | }
|
---|
50 | }
|
---|
51 | }
|
---|