Changeset 15032 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite
- Timestamp:
- 06/12/17 14:11:43 (7 years ago)
- Location:
- branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/DataTypes.cs
r14897 r15032 3 3 4 4 [Flags] 5 public enum DataTypes : ushort{5 public enum DataTypes { 6 6 None = 0x01, // Required to specify expression dependencies 7 7 Integer = 0x02, -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/NumberIo.cs
r15017 r15032 24 24 WorstResult = 400, 25 25 InputArgumentTypes = new[] { ExampleArgumentType.Float, ExampleArgumentType.Integer }, 26 OutputArgumentTypes = new[] { ExampleArgumentType. Print },26 OutputArgumentTypes = new[] { ExampleArgumentType.Float }, 27 27 TrainingCount = 25, 28 28 TestCount = 1000, 29 EnabledDataTypes = DataTypes.Integer | DataTypes.Float | DataTypes.Print,29 EnabledDataTypes = DataTypes.Integer | DataTypes.Float, // | DataTypes.Print, 30 30 EvalLimit = 200, 31 31 MaxSize = 200, … … 47 47 InputFloat = ExampleArgumentConverter.ConvertDoubles(input[0]), 48 48 InputInteger = ExampleArgumentConverter.ConvertIntegers(input[1]), 49 //OutputFloat = new[] { estimedFloatValue },50 OutputPrint = estimedFloatValue.ToString("R", CultureInfo.InvariantCulture),49 OutputFloat = ExampleArgumentConverter.ConvertDoubles(output), 50 //OutputPrint = estimedFloatValue.ToString("R", CultureInfo.InvariantCulture), 51 51 }; 52 52 } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Views/DataEditorView.cs
r14952 r15032 188 188 var type = Content.InputArgumentTypes[i]; 189 189 var offset = inputArgumentCountDict[type]; 190 row.Cells[i].Value = ViewHelper.StringifyInput(type, offset, example, ValueSeparator);190 row.Cells[i].Value = ViewHelper.StringifyInput(type, offset, "R", example, ValueSeparator); 191 191 inputArgumentCountDict[type]++; 192 192 } … … 196 196 var type = Content.OutputArgumentTypes[i]; 197 197 var offset = outputArgumentCountDict[type]; 198 row.Cells[Content.InputArgumentTypes.Length + i].Value = ViewHelper.StringifyOutput(type, offset, example, ValueSeparator);198 row.Cells[Content.InputArgumentTypes.Length + i].Value = ViewHelper.StringifyOutput(type, offset, "R", example, ValueSeparator); 199 199 outputArgumentCountDict[type]++; 200 200 } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Views/ViewHelper.cs
r14952 r15032 6 6 7 7 public static class ViewHelper { 8 public static string StringifyInput(ExampleArgumentType type, int offset, Example example, string valueSeparator) {8 public static string StringifyInput(ExampleArgumentType type, int offset, string floatFormat, Example example, string valueSeparator) { 9 9 switch (type) { 10 10 case ExampleArgumentType.Integer: return example.InputInteger[offset].ToString(); 11 11 case ExampleArgumentType.IntegerVector: return "[" + string.Join(", ", example.InputIntegerVector[offset]) + "]"; 12 12 13 case ExampleArgumentType.Float: return example.InputFloat[offset].ToString( CultureInfo.CurrentUICulture);14 case ExampleArgumentType.FloatVector: return "[" + string.Join(", ", example.InputFloatVector[offset] ) + "]";13 case ExampleArgumentType.Float: return example.InputFloat[offset].ToString(floatFormat, CultureInfo.CurrentUICulture); 14 case ExampleArgumentType.FloatVector: return "[" + string.Join(", ", example.InputFloatVector[offset].Select(x => x.ToString(floatFormat, CultureInfo.InvariantCulture))) + "]"; 15 15 16 16 case ExampleArgumentType.Boolean: return example.InputBoolean[offset].ToString(); … … 24 24 } 25 25 26 public static string StringifyOutput(ExampleArgumentType type, int offset, Example example, string valueSeparator) {26 public static string StringifyOutput(ExampleArgumentType type, int offset, string floatFormat, Example example, string valueSeparator) { 27 27 switch (type) { 28 28 case ExampleArgumentType.Integer: return example.OutputInteger[offset].ToString(); 29 29 case ExampleArgumentType.IntegerVector: return "[" + string.Join(", ", example.OutputIntegerVector[offset]) + "]"; 30 30 31 case ExampleArgumentType.Float: return example.OutputFloat[offset].ToString( CultureInfo.CurrentUICulture);32 case ExampleArgumentType.FloatVector: return "[" + string.Join(", ", example.OutputFloatVector[offset] ) + "]";31 case ExampleArgumentType.Float: return example.OutputFloat[offset].ToString(floatFormat, CultureInfo.InvariantCulture); 32 case ExampleArgumentType.FloatVector: return "[" + string.Join(", ", example.OutputFloatVector[offset].Select(x => x.ToString(floatFormat, CultureInfo.InvariantCulture))) + "]"; 33 33 34 34 case ExampleArgumentType.Boolean: return example.OutputBoolean[offset].ToString();
Note: See TracChangeset
for help on using the changeset viewer.