Changeset 14834 for branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems
- Timestamp:
- 04/10/17 00:27:31 (8 years ago)
- Location:
- branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/CountOdds.cs
r14777 r14834 1 1 namespace HeuristicLab.BenchmarkSuite.Problems { 2 using HeuristicLab.BenchmarkSuite.ERC;3 using HeuristicLab.Data;4 2 5 3 public class CountOdds : BenchmarkSuiteDataDescriptor { … … 7 5 private const string fileName = "CountOdds.csv"; 8 6 private const string description = ""; 9 private readonly ExampleArgumentType[] inputArgumentTypes = { ExampleArgumentType.IntegerCollection };10 private readonly ExampleArgumentType[] outputArgumentTypes = { ExampleArgumentType.Integer };11 7 12 private readonly DataTypes enabledDataTypeses = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.IntegerVector; 13 private readonly ProblemErcOptions problemErcOptions = new ProblemErcOptions { 14 IntegerErcRange = new ErcOptionRange<IntValue>( 15 new IntValue(-1000), 16 new IntValue(1000), 17 new IntValue(0), 18 new IntValue(1), 19 new IntValue(2)) 20 }; 21 8 protected override string FileName { get { return fileName; } } 22 9 public override string Name { get { return name; } } 23 10 public override string Description { get { return description; } } 24 protected override string FileName { get { return fileName; } } 25 public override ExampleArgumentType[] InputArgumentTypes { get { return inputArgumentTypes; } } 26 public override ExampleArgumentType[] OutputArgumentTypes { get { return outputArgumentTypes; } } 27 public override int OriginalTrainingCount { get { return 200; } } 28 public override int OriginalTestCount { get { return 2000; } } 29 public override int BestResult { get { return 0; } } 30 public override int WorstResult { get { return 50; } } 31 public override ProblemErcOptions ProblemErcOptions { get { return this.problemErcOptions; } } 32 public override DataTypes EnabledDataTypes { get { return this.enabledDataTypeses; } } 33 public override int MaxSize { get { return 500; } } 34 public override int EvalLimit { get { return 1500; } } 35 public override int MaxGenerations { get { return 300; } } 36 public override int ProgEvalBudget { get { return 60000000; } } 11 protected override int InputArgumentCount { get { return 1; } } 12 protected override int OutputArgumentCount { get { return 1; } } 37 13 38 public override Example ParseExample(string[] input, string[] output) { 14 public override Data CreateProblemData() { 15 return new Data { 16 Name = Name, 17 Description = Description, 18 Examples = CloneExamples(), 19 BestResult = 0, 20 WorstResult = 50, 21 InputArgumentTypes = new[] { ExampleArgumentType.IntegerCollection }, 22 OutputArgumentTypes = new[] { ExampleArgumentType.Integer }, 23 OriginalTestCount = 2000, 24 OriginalTrainingCount = 200, 25 EnabledDataTypes = DataTypes.Exec | DataTypes.Integer | DataTypes.Boolean | DataTypes.IntegerVector, 26 EvalLimit = 1500, 27 MaxSize = 500, 28 }; 29 } 30 31 protected override Example ParseExample(string[] input, string[] output) { 39 32 return new Example { 40 33 InputArgs = input, -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/Data.cs
r14777 r14834 2 2 using System.Linq; 3 3 4 using HeuristicLab.BenchmarkSuite.ERC;5 4 using HeuristicLab.Common; 6 5 using HeuristicLab.Core; … … 16 15 17 16 public Data(Data origin, Cloner cloner) : base(origin, cloner) { 18 Name = origin.Name;19 Description = origin.Description;20 17 OriginalTrainingCount = origin.OriginalTrainingCount; 21 18 OriginalTestCount = origin.OriginalTestCount; … … 24 21 InputArgumentTypes = origin.InputArgumentTypes; 25 22 OutputArgumentTypes = origin.OutputArgumentTypes; 26 Examples = origin.Examples.ToArray(); 23 24 if (origin.Examples != null) 25 Examples = origin.Examples.Select(e => (Example)e.Clone(cloner)).ToArray(); 26 27 27 EnabledDataTypes = origin.EnabledDataTypes; 28 this.ProblemErcOptions = cloner.Clone(origin.ProblemErcOptions);29 28 } 30 29 31 [Storable]32 public string Name { get; set; }33 [Storable]34 public string Description { get; set; }35 30 [Storable] 36 31 public int OriginalTrainingCount { get; set; } … … 38 33 public int OriginalTestCount { get; set; } 39 34 [Storable] 40 public intBestResult { get; set; }35 public double BestResult { get; set; } 41 36 [Storable] 42 public intWorstResult { get; set; }37 public double WorstResult { get; set; } 43 38 [Storable] 44 39 public ExampleArgumentType[] InputArgumentTypes { get; set; } … … 48 43 [Storable] 49 44 public Example[] Examples { get; set; } 50 [Storable]51 public ProblemErcOptions ProblemErcOptions { get; set; }52 45 [Storable] 53 46 public DataTypes EnabledDataTypes { get; set; } … … 67 60 public int EvalLimit { get; set; } 68 61 69 /// <summary>70 /// “Max Gens” gives the maximum number of generations in a single PushGP run.71 /// </summary>72 [Storable]73 public int MaxGenerations { get; set; }74 75 /// <summary>76 /// “Prog Eval Budget” is the maximum number of programs that will be evaluated before a run is terminated.77 /// </summary>78 [Storable]79 public int ProgEvalBudget { get; set; }80 81 62 public override IDeepCloneable Clone(Cloner cloner) { 82 63 return new Data(this, cloner); -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Problems/NumberIo.cs
r14727 r14834 1 //namespace HeuristicLab.BenchmarkSuite.Problems { 2 // using System.Linq; 1 namespace HeuristicLab.BenchmarkSuite.Problems { 2 public class NumberIO : BenchmarkSuiteDataDescriptor { 3 private const string name = "NumberIO"; 4 private const string fileName = "NumberIO.csv"; 5 private const string description = "Given an integer and a float, calc their sum."; 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 2; } } 11 protected override int OutputArgumentCount { get { return 1; } } 5 12 6 // public class NumberIo : BenchmarkSuiteDataDescriptor<double[], double> { 7 // private const string displayMame = "NumberIO"; 8 // private const string description = " Given an integer and a float, print their sum."; 13 public override Data CreateProblemData() { 14 return new Data { 15 Name = Name, 16 Description = Description, 17 Examples = CloneExamples(), 18 BestResult = 0, 19 WorstResult = 400, 20 InputArgumentTypes = new[] { ExampleArgumentType.Float, ExampleArgumentType.Integer }, 21 OutputArgumentTypes = new[] { ExampleArgumentType.Float }, 22 OriginalTrainingCount = 25, 23 OriginalTestCount = 1000, 24 EnabledDataTypes = DataTypes.Integer | DataTypes.Float, 25 EvalLimit = 200, 26 MaxSize = 200, 27 }; 28 } 9 29 10 // public override string Name { get { return displayMame; } } 11 // public override string Description { get { return description; } } 30 protected override Example ParseExample(string[] input, string[] output) { 31 return new Example { 32 InputArgs = input, 33 OutputArgs = output, 34 InputFloat = ExampleArgumentConverter.ConvertDoubles(input[0]), 35 InputInt = ExampleArgumentConverter.ConvertIntegers(input[1]), 36 OutputFloat = ExampleArgumentConverter.ConvertDoubles(output[0]) 37 }; 38 } 39 } 40 } 12 41 13 // protected override int InputArgumentCount { get { return 2; } }14 // protected override int OutputArgumentCount { get { return 1; } }15 16 // public override double[] ConvertInput(string[] input) {17 // return input.Select(ConvertDouble).ToArray();18 // }19 20 // public override double ConvertOutput(string[] output) {21 // return ConvertDouble(output[0]);22 // }23 24 // public override IPushData CreatePushData(Example<double[], double>[] training, Example<double[], double>[] test) {25 // return new NumberIoPushData(training, test);26 // }27 // }28 //}
Note: See TracChangeset
for help on using the changeset viewer.