Changeset 14898
- Timestamp:
- 04/28/17 23:33:27 (8 years ago)
- Location:
- branches/PushGP/HeuristicLab.PushGP
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problem.ProgramSynthesis.BenchmarkSuite/Views/ViewHelper.cs
r14875 r14898 3 3 public static string StringifyInput(ExampleArgumentType type, Example example, string valueSeparator) { 4 4 switch (type) { 5 case ExampleArgumentType.Integer: 6 case ExampleArgumentType.IntegerVector: return string.Join(valueSeparator, example.InputInteger);5 case ExampleArgumentType.Integer: return string.Join(valueSeparator, example.InputInteger); 6 //case ExampleArgumentType.IntegerVector: return string.Join(valueSeparator, example.InputInteger); 7 7 8 case ExampleArgumentType.Float: 9 case ExampleArgumentType.FloatVector: return string.Join(valueSeparator, example.InputFloat);8 case ExampleArgumentType.Float: return string.Join(valueSeparator, example.InputFloat); 9 //case ExampleArgumentType.FloatVector: return string.Join(valueSeparator, example.InputFloat); 10 10 11 11 case ExampleArgumentType.Boolean: return string.Join(valueSeparator, example.InputBoolean); 12 12 case ExampleArgumentType.Char: return string.Join(valueSeparator, example.InputChar); 13 13 14 case ExampleArgumentType.String: 15 case ExampleArgumentType.StringVector: return string.Join(valueSeparator, example.InputString);14 case ExampleArgumentType.String: return string.Join(valueSeparator, example.InputString); 15 //case ExampleArgumentType.StringVector: return string.Join(valueSeparator, example.InputString); 16 16 default: return string.Empty; 17 17 } … … 20 20 public static string StringifyOutput(ExampleArgumentType type, Example example, string valueSeparator) { 21 21 switch (type) { 22 case ExampleArgumentType.Integer: 23 case ExampleArgumentType.IntegerVector: return string.Join(valueSeparator, example.OutputInteger);22 case ExampleArgumentType.Integer: return string.Join(valueSeparator, example.OutputInteger); 23 //case ExampleArgumentType.IntegerVector: return string.Join(valueSeparator, example.OutputIntegerVector); 24 24 25 case ExampleArgumentType.Float: 26 case ExampleArgumentType.FloatVector: return string.Join(valueSeparator, example.OutputFloat);25 case ExampleArgumentType.Float: return string.Join(valueSeparator, example.OutputFloat); 26 //case ExampleArgumentType.FloatVector: return string.Join(valueSeparator, example.OutputFloat); 27 27 28 28 case ExampleArgumentType.Boolean: return string.Join(valueSeparator, example.OutputBoolean); 29 29 case ExampleArgumentType.Char: return string.Join(valueSeparator, example.OutputChar); 30 30 31 case ExampleArgumentType.String: 32 case ExampleArgumentType.StringVector: return string.Join(valueSeparator, example.OutputString);31 case ExampleArgumentType.String: return string.Join(valueSeparator, example.OutputString); 32 //case ExampleArgumentType.StringVector: return string.Join(valueSeparator, example.OutputString); 33 33 default: return string.Empty; 34 34 } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Boolean/BooleanRandomErcValue.cs
r14897 r14898 21 21 } 22 22 23 Name = "Boolean random"; 23 24 IsEnabled = isEnabled; 24 25 Parameters.Add(new FixedValueParameter<BoolValue>(AllowTrueParameterName, new BoolValue(allowTrue))); -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Float/FloatConstantErcValue.cs
r14897 r14898 9 9 public FloatConstantErcValue() : this(new double[0]) { } 10 10 11 public FloatConstantErcValue(params double[] constants) : base(new DoubleArray(constants)) { } 11 public FloatConstantErcValue(params double[] constants) 12 : base(new DoubleArray(constants)) { 13 Name = "Float constants"; 14 } 12 15 13 16 [StorableConstructor] -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Float/FloatRangeErcValue.cs
r14897 r14898 11 11 12 12 public FloatRangeErcValue() { 13 Name = "Float range"; 13 14 this.Parameters.Add(new FixedValueParameter<DoubleRange>(RangeParameterName)); 14 15 } -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/FloatVector/FloatVectorConstantsErcValue.cs
r14897 r14898 8 8 [StorableClass] 9 9 public class FloatVectorConstantsErcValue : VectorConstantsErcValue<double, DoubleArray> { 10 public FloatVectorConstantsErcValue() { 11 } 10 public FloatVectorConstantsErcValue() : this(new double[0][]) { } 12 11 13 12 public FloatVectorConstantsErcValue(params double[][] values) … … 17 16 public FloatVectorConstantsErcValue(bool isEnabled, params double[][] values) 18 17 : base(isEnabled, values.Select(v => new DoubleArray(v)).ToArray()) { 18 Name = "Float vector constants"; 19 19 } 20 20 -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Integer/IntegerConstantErcValue.cs
r14897 r14898 9 9 public IntegerConstantErcValue() : this(new int[0]) { } 10 10 11 public IntegerConstantErcValue(params int[] constants) : base(new IntArray(constants)) { } 11 public IntegerConstantErcValue(params int[] constants) 12 : base(new IntArray(constants)) { 13 Name = "Integer constants"; 14 } 12 15 13 16 [StorableConstructor] -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Integer/IntegerRangeErcValue.cs
r14897 r14898 11 11 12 12 public IntegerRangeErcValue() { 13 this.Parameters.Add(new FixedValueParameter<IntRange>(RangeParameterName)); 13 Name = "Integer range"; 14 Parameters.Add(new FixedValueParameter<IntRange>(RangeParameterName)); 14 15 } 15 16 16 17 public IntegerRangeErcValue(int start, int end) : this() { 17 this.Start = start;18 this.End = end;18 Start = start; 19 End = end; 19 20 } 20 21 -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/IntegerVector/IntegerVectorConstantsErcValue.cs
r14897 r14898 8 8 [StorableClass] 9 9 public class IntegerVectorConstantsErcValue : VectorConstantsErcValue<int, IntArray> { 10 public IntegerVectorConstantsErcValue() { 11 } 10 public IntegerVectorConstantsErcValue() : this(new int[0][]) { } 12 11 13 public IntegerVectorConstantsErcValue(params int[][] values) 14 : this(true, values) { 15 } 12 public IntegerVectorConstantsErcValue(params int[][] values) : this(true, values) { } 16 13 17 14 public IntegerVectorConstantsErcValue(bool isEnabled, params int[][] values) 18 15 : base(isEnabled, values.Select(v => new IntArray(v)).ToArray()) { 16 Name = "Integer vector constants"; 19 17 } 20 18 -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/String/StringConstantErcValue.cs
r14897 r14898 17 17 18 18 public StringConstantErcValue(params string[] constants) { 19 Name = "String constants"; 19 20 array = new StringArray(constants); 20 21 Parameters.Add(new FixedValueParameter<StringArray>(ConstantsParameterName, array)); -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/String/StringRandomErcValue.cs
r14897 r14898 28 28 29 29 public StringRandomErcValue() { 30 Name = "String random"; 30 31 Parameters.Add(new FixedValueParameter<BoolValue>(AllowLowercaseLettersParameterName, new BoolValue(true))); 31 32 Parameters.Add(new FixedValueParameter<BoolValue>(AllowUppercaseLettersParameterName, new BoolValue(true))); -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/StringVector/StringVectorConstantsErcValue.cs
r14897 r14898 17 17 private readonly StringArray[] arrays; // perf opt: avoid using parameter getter 18 18 19 public StringVectorConstantsErcValue() : this(false, new StringArray[0]) { } 20 19 21 public StringVectorConstantsErcValue(params StringArray[] arrays) : this(true, arrays) { } 20 22 21 23 public StringVectorConstantsErcValue(bool isEnabled, params StringArray[] arrays) { 22 24 this.arrays = arrays; 25 Name = "String vector constants"; 23 26 IsEnabled = isEnabled; 24 Parameters.Add(new ValueParameter<Item Array<StringArray>>(ConstantsParameterName, new ItemArray<StringArray>(arrays)));27 Parameters.Add(new ValueParameter<ItemCollection<StringArray>>(ConstantsParameterName, new ItemCollection<StringArray>(arrays))); 25 28 } 26 29 … … 30 33 public StringVectorConstantsErcValue(StringVectorConstantsErcValue origin, Cloner cloner) : base(origin, cloner) { } 31 34 32 public IValueParameter<Item Array<StringArray>> ConstantsParameter35 public IValueParameter<ItemCollection<StringArray>> ConstantsParameter 33 36 { 34 get { return (IValueParameter<Item Array<StringArray>>)Parameters[ConstantsParameterName]; }37 get { return (IValueParameter<ItemCollection<StringArray>>)Parameters[ConstantsParameterName]; } 35 38 } 36 39 -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/VectorConstantsErcValue.cs
r14897 r14898 22 22 this.arrays = arrays; 23 23 IsEnabled = isEnabled; 24 Parameters.Add(new ValueParameter<Item Array<TValue>>(ConstantsParameterName, new ItemArray<TValue>(arrays)));24 Parameters.Add(new ValueParameter<ItemCollection<TValue>>(ConstantsParameterName, new ItemCollection<TValue>(arrays))); 25 25 } 26 26 … … 30 30 protected VectorConstantsErcValue(VectorConstantsErcValue<T, TValue> origin, Cloner cloner) : base(origin, cloner) { } 31 31 32 public IValueParameter<Item Array<TValue>> ConstantsParameter32 public IValueParameter<ItemCollection<TValue>> ConstantsParameter 33 33 { 34 get { return (IValueParameter<Item Array<TValue>>)Parameters[ConstantsParameterName]; }34 get { return (IValueParameter<ItemCollection<TValue>>)Parameters[ConstantsParameterName]; } 35 35 } 36 36 -
branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.ProgramSynthesis.csproj
r14897 r14898 189 189 <Compile Include="Push\Generators\CodeGenerator\LinearCodeGenerator.cs" /> 190 190 <Compile Include="Push\Generators\CodeGenerator\RecursiveCodeGenerator.cs" /> 191 <Compile Include="Push\Generators\ErcUtils.cs" />192 191 <Compile Include="Push\Interpreter\Extensions.cs" /> 193 192 <Compile Include="Push\Interpreter\IInternalPushInterpreter.cs" />
Note: See TracChangeset
for help on using the changeset viewer.