Changeset 15189 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite
- Timestamp:
- 07/10/17 21:36:03 (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/BenchmarkSuiteDataDescriptor.cs
r15017 r15189 30 30 protected abstract Example ParseExample(string[] input, string[] output); 31 31 32 //private IEnumerable<Example> ParseData() {33 // using (var file = GetType().Assembly.GetManifestResourceStream(InstanceArchiveName))34 // using (var archive = new ZipArchive(file, ZipArchiveMode.Read)) {35 // var entry = archive.Entries.SingleOrDefault(x => x.Name == FileName);36 37 // using (var parser = new TextFieldParser(entry.Open())) {38 // parser.TextFieldType = FieldType.Delimited;39 // parser.SetDelimiters(ExampleFieldDelimiter);40 // parser.HasFieldsEnclosedInQuotes = true;41 // parser.TrimWhiteSpace = false;42 43 // //Processing rows44 // while (!parser.EndOfData) {45 // var fields = parser.ReadFields();46 47 // if (fields.Length != InputArgumentCount + OutputArgumentCount)48 // throw new InvalidDataException("Number of values do not fit");49 50 // var input = fields.Take(InputArgumentCount).ToArray();51 // var output = fields.Skip(InputArgumentCount).ToArray();52 53 // yield return ParseExample(input, output);54 // }55 // }56 // }57 //}58 59 32 private IEnumerable<Example> ParseData() { 60 33 using (var file = GetType().Assembly.GetManifestResourceStream(InstanceArchiveName)) … … 69 42 var output = line.Skip(InputArgumentCount).ToArray(); 70 43 71 yield return ParseExample(input, output); 44 var example = ParseExample(input, output); 45 46 yield return example; 72 47 } 73 48 } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/ProblemData.cs
r15017 r15189 34 34 ErcOptions = cloner.Clone(origin.ErcOptions); 35 35 FloatStringFormat = origin.FloatStringFormat; 36 ProblemType = origin.ProblemType; 36 37 } 37 38 … … 51 52 [Storable] 52 53 public ExampleArgumentType[] OutputArgumentTypes { get; set; } 54 55 public int TotalIntputArgumentCount { get { return InputArgumentTypes.Length; } } 56 public int TotalOutputArgumentCount { get { return OutputArgumentTypes.Length; } } 53 57 public int TotalArgumentCount { get { return InputArgumentTypes.Length + OutputArgumentTypes.Length; } } 58 54 59 [Storable] 55 60 public Example[] Examples { get; set; } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/Checksum.cs
r15017 r15189 2 2 using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Char; 3 3 using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.Integer; 4 using HeuristicLab.Problems.ProgramSynthesis.Base.Erc.String; 4 5 5 6 public class Checksum : BenchmarkSuiteDataDescriptor { … … 35 36 CharErcOptions = new CharErcOptions( 36 37 new IntegerConstantErc(' '), 37 new IntegerRangeErc(0x20, 0x7e)) 38 new IntegerRangeErc(0x20, 0x7e)), 39 StringErcOptions = new StringErcOptions( 40 new StringConstantErc("Check sum is ")) 38 41 } 39 42 }; -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/NumberIo.cs
r15032 r15189 24 24 WorstResult = 400, 25 25 InputArgumentTypes = new[] { ExampleArgumentType.Float, ExampleArgumentType.Integer }, 26 OutputArgumentTypes = new[] { ExampleArgumentType. Float },26 OutputArgumentTypes = new[] { ExampleArgumentType.Print }, 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, … … 48 48 InputInteger = ExampleArgumentConverter.ConvertIntegers(input[1]), 49 49 OutputFloat = ExampleArgumentConverter.ConvertDoubles(output), 50 //OutputPrint = estimedFloatValue.ToString("R", CultureInfo.InvariantCulture),50 OutputPrint = estimedFloatValue.ToString("R", CultureInfo.InvariantCulture), 51 51 }; 52 52 }
Note: See TracChangeset
for help on using the changeset viewer.