Changeset 14875 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/MirrorImage.cs
- Timestamp:
- 04/18/17 01:15:25 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/MirrorImage.cs
r14727 r14875 1 //namespace HeuristicLab.BenchmarkSuite.Problems { 2 // using System.Linq; 1 namespace HeuristicLab.BenchmarkSuite.Problems { 3 2 4 // using HeuristicLab.BenchmarkSuite.ProblemData; 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."; 5 7 6 // public class MirrorImage : BenchmarkSuiteDataDescriptor<long[][], bool> { 7 // private const string displayMame = "Mirror Image"; 8 // private const string description = "Given two vectors of integers, return true if one vector is the reverse of the other, and false otherwise"; 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; } } 9 13 10 // public override string Name { get { return displayMame; } } 11 // public override string Description { get { return description; } } 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 } 12 38 13 // protected override int InputArgumentCount { get { return 2; } } 14 // protected override int OutputArgumentCount { get { return 1; } } 15 16 // public override long[][] ConvertInput(string[] input) { 17 // return input.Select(ConvertIntegers).ToArray(); 18 // } 19 20 // public override bool ConvertOutput(string[] output) { 21 // return ConvertBool(output[0]); 22 // } 23 24 // public override IPushData CreatePushData(Example<long[][], bool>[] training, Example<long[][], bool>[] test) { 25 // return new MirrorImagePushData(training, test); 26 // } 27 // } 28 //} 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 }
Note: See TracChangeset
for help on using the changeset viewer.