Changeset 14875 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/NegativeToZero.cs
- Timestamp:
- 04/18/17 01:15:25 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/NegativeToZero.cs
r14727 r14875 1 //namespace HeuristicLab.BenchmarkSuite.Problems { 2 // using HeuristicLab.BenchmarkSuite.ProblemData; 1 namespace HeuristicLab.BenchmarkSuite.Problems { 2 public class NegativeToZero : BenchmarkSuiteDataDescriptor { 3 private const string name = "Negative to Zero"; 4 private const string fileName = "NegativeToZero.csv"; 5 private const string description = "Given a vector of integers, return the vector where all negative integers have been replaced by 0."; 3 6 4 // public class NegativeToZero : BenchmarkSuiteDataDescriptor<long[], long[]> { 5 // private const string displayMame = "Negative To Zero"; 6 // private const string description = "Given a vector of integers, return the vector where all negative integers have been replaced by 0."; 7 protected override string FileName { get { return fileName; } } 8 public override string Name { get { return name; } } 9 public override string Description { get { return description; } } 10 protected override int InputArgumentCount { get { return 1; } } 11 protected override int OutputArgumentCount { get { return 1; } } 7 12 8 // public override string Name { get { return displayMame; } } 9 // public override string Description { get { return description; } } 13 public override ProblemData CreateProblemData() { 14 return new ProblemData { 15 Name = Name, 16 Description = Description, 17 Examples = CloneExamples(), 18 BestResult = 0, 19 WorstResult = 50000, 20 InputArgumentTypes = new[] { ExampleArgumentType.IntegerVector }, 21 OutputArgumentTypes = new[] { ExampleArgumentType.IntegerVector }, 22 TrainingCount = 200, 23 TestCount = 2000, 24 EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.IntegerVector, 25 MaxSize = 500, 26 EvalLimit = 1500, 27 ErcOptions = { 28 ErcProbability = 0.05, 29 IntegerErcOptions = { 30 IsEnabled = true, 31 Constants = new [] { 0 } 32 }, 33 IntegerVectorErcOptions = { 34 IsEnabled = true, 35 Constants = new [] { new int[0] } 36 } 37 } 38 }; 39 } 10 40 11 // protected override int InputArgumentCount { get { return 1; } } 12 // protected override int OutputArgumentCount { get { return 1; } } 13 14 // public override long[] ConvertInput(string[] input) { 15 // return ConvertIntegers(input[0]); 16 // } 17 18 // public override long[] ConvertOutput(string[] output) { 19 // return ConvertIntegers(output[0]); 20 // } 21 22 // public override IPushData CreatePushData(Example<long[], long[]>[] training, Example<long[], long[]>[] test) { 23 // return new NegativeToZeroPushData(training, test); 24 // } 25 // } 26 //} 41 protected override Example ParseExample(string[] input, string[] output) { 42 return new Example { 43 InputArgs = input, 44 OutputArgs = output, 45 InputIntegerVector = new[] { ExampleArgumentConverter.ConvertIntegers(input[0]) }, 46 OutputIntegerVector = new[] { ExampleArgumentConverter.ConvertIntegers(output[0]) }, 47 }; 48 } 49 } 50 }
Note: See TracChangeset
for help on using the changeset viewer.