Changeset 15017 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/NumberIo.cs
- Timestamp:
- 06/01/17 09:28:34 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/NumberIo.cs
r14952 r15017 1 1 namespace HeuristicLab.BenchmarkSuite.Problems { 2 using System.Globalization; 3 2 4 using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Float; 3 5 using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Integer; … … 15 17 16 18 public override ProblemData CreateProblemData() { 17 return new ProblemData {19 return new ProblemData(ProblemType.NumberIO) { 18 20 Name = Name, 19 21 Description = Description, … … 22 24 WorstResult = 400, 23 25 InputArgumentTypes = new[] { ExampleArgumentType.Float, ExampleArgumentType.Integer }, 24 OutputArgumentTypes = new[] { ExampleArgumentType. Float },26 OutputArgumentTypes = new[] { ExampleArgumentType.Print }, 25 27 TrainingCount = 25, 26 28 TestCount = 1000, … … 39 41 40 42 protected override Example ParseExample(string[] input, string[] output) { 43 var estimedFloatValue = double.Parse(output[0], CultureInfo.InvariantCulture); 41 44 return new Example { 42 45 InputArgs = input, … … 44 47 InputFloat = ExampleArgumentConverter.ConvertDoubles(input[0]), 45 48 InputInteger = ExampleArgumentConverter.ConvertIntegers(input[1]), 46 OutputFloat = ExampleArgumentConverter.ConvertDoubles(output[0]),47 //OutputPrint = output[0]49 //OutputFloat = new[] { estimedFloatValue }, 50 OutputPrint = estimedFloatValue.ToString("R", CultureInfo.InvariantCulture), 48 51 }; 49 52 }
Note: See TracChangeset
for help on using the changeset viewer.