Changeset 14875 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/EvenSquares.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/EvenSquares.cs
r14727 r14875 1 //namespace HeuristicLab.BenchmarkSuite.Problems { 2 // using System.Linq; 1 namespace HeuristicLab.BenchmarkSuite.Problems { 2 public class EvenSquares : BenchmarkSuiteDataDescriptor { 3 private const string name = "Even Sqaures"; 4 private const string fileName = "EvenSquares.csv"; 5 private const string description = " Given an integer n, print all of the positive even perfect squares less than n on separate lines."; 3 6 4 // using HeuristicLab.BenchmarkSuite.ProblemData; 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; } } 5 12 6 // public class EvenSquares : BenchmarkSuiteDataDescriptor<long, long[]> { 7 // private const string displayMame = "Even Squares"; 8 // private const string description = ""; 13 public override ProblemData CreateProblemData() { 14 return new ProblemData { 15 Name = Name, 16 Description = Description, 17 Examples = CloneExamples(), 18 BestResult = 0, 19 WorstResult = 400, 20 InputArgumentTypes = new[] { ExampleArgumentType.Integer }, 21 OutputArgumentTypes = new[] { ExampleArgumentType.String }, 22 TrainingCount = 100, 23 TestCount = 1000, 24 EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean, 25 MaxSize = 400, 26 EvalLimit = 2000, 27 }; 28 } 9 29 10 // public override string Name { get { return displayMame; } } 11 // public override string Description { get { return description; } } 12 13 // protected override int InputArgumentCount { get { return 1; } } 14 // protected override int OutputArgumentCount { get { return 1; } } 15 16 // public override long ConvertInput(string[] input) { 17 // return ConvertInteger(input[0]); 18 // } 19 20 // public override long[] ConvertOutput(string[] output) { 21 // return SplitByNewLine(output[0]) 22 // .Select(ConvertInteger) 23 // .ToArray(); 24 // } 25 26 // public override IPushData CreatePushData(Example<long, long[]>[] training, Example<long, long[]>[] test) { 27 // return new EvenSquaresPushData(training, test); 28 // } 29 // } 30 //} 30 protected override Example ParseExample(string[] input, string[] output) { 31 return new Example { 32 InputArgs = input, 33 OutputArgs = output, 34 InputInteger = ExampleArgumentConverter.ConvertIntegers(input), 35 OutputString = output, 36 }; 37 } 38 } 39 }
Note: See TracChangeset
for help on using the changeset viewer.