Free cookie consent management tool by TermsFeed Policy Generator

Changeset 14898 for branches


Ignore:
Timestamp:
04/28/17 23:33:27 (8 years ago)
Author:
pkimmesw
Message:

#2665 Set name properties of ERC values

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  
    33    public static string StringifyInput(ExampleArgumentType type, Example example, string valueSeparator) {
    44      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);
    77
    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);
    1010
    1111        case ExampleArgumentType.Boolean: return string.Join(valueSeparator, example.InputBoolean);
    1212        case ExampleArgumentType.Char: return string.Join(valueSeparator, example.InputChar);
    1313
    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);
    1616        default: return string.Empty;
    1717      }
     
    2020    public static string StringifyOutput(ExampleArgumentType type, Example example, string valueSeparator) {
    2121      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);
    2424
    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);
    2727
    2828        case ExampleArgumentType.Boolean: return string.Join(valueSeparator, example.OutputBoolean);
    2929        case ExampleArgumentType.Char: return string.Join(valueSeparator, example.OutputChar);
    3030
    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);
    3333        default: return string.Empty;
    3434      }
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Boolean/BooleanRandomErcValue.cs

    r14897 r14898  
    2121      }
    2222
     23      Name = "Boolean random";
    2324      IsEnabled = isEnabled;
    2425      Parameters.Add(new FixedValueParameter<BoolValue>(AllowTrueParameterName, new BoolValue(allowTrue)));
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Float/FloatConstantErcValue.cs

    r14897 r14898  
    99    public FloatConstantErcValue() : this(new double[0]) { }
    1010
    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    }
    1215
    1316    [StorableConstructor]
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Float/FloatRangeErcValue.cs

    r14897 r14898  
    1111
    1212    public FloatRangeErcValue() {
     13      Name = "Float range";
    1314      this.Parameters.Add(new FixedValueParameter<DoubleRange>(RangeParameterName));
    1415    }
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/FloatVector/FloatVectorConstantsErcValue.cs

    r14897 r14898  
    88  [StorableClass]
    99  public class FloatVectorConstantsErcValue : VectorConstantsErcValue<double, DoubleArray> {
    10     public FloatVectorConstantsErcValue() {
    11     }
     10    public FloatVectorConstantsErcValue() : this(new double[0][]) { }
    1211
    1312    public FloatVectorConstantsErcValue(params double[][] values)
     
    1716    public FloatVectorConstantsErcValue(bool isEnabled, params double[][] values)
    1817      : base(isEnabled, values.Select(v => new DoubleArray(v)).ToArray()) {
     18      Name = "Float vector constants";
    1919    }
    2020
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Integer/IntegerConstantErcValue.cs

    r14897 r14898  
    99    public IntegerConstantErcValue() : this(new int[0]) { }
    1010
    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    }
    1215
    1316    [StorableConstructor]
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/Integer/IntegerRangeErcValue.cs

    r14897 r14898  
    1111
    1212    public IntegerRangeErcValue() {
    13       this.Parameters.Add(new FixedValueParameter<IntRange>(RangeParameterName));
     13      Name = "Integer range";
     14      Parameters.Add(new FixedValueParameter<IntRange>(RangeParameterName));
    1415    }
    1516
    1617    public IntegerRangeErcValue(int start, int end) : this() {
    17       this.Start = start;
    18       this.End = end;
     18      Start = start;
     19      End = end;
    1920    }
    2021
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/IntegerVector/IntegerVectorConstantsErcValue.cs

    r14897 r14898  
    88  [StorableClass]
    99  public class IntegerVectorConstantsErcValue : VectorConstantsErcValue<int, IntArray> {
    10     public IntegerVectorConstantsErcValue() {
    11     }
     10    public IntegerVectorConstantsErcValue() : this(new int[0][]) { }
    1211
    13     public IntegerVectorConstantsErcValue(params int[][] values)
    14       : this(true, values) {
    15     }
     12    public IntegerVectorConstantsErcValue(params int[][] values) : this(true, values) { }
    1613
    1714    public IntegerVectorConstantsErcValue(bool isEnabled, params int[][] values)
    1815      : base(isEnabled, values.Select(v => new IntArray(v)).ToArray()) {
     16      Name = "Integer vector constants";
    1917    }
    2018
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/String/StringConstantErcValue.cs

    r14897 r14898  
    1717
    1818    public StringConstantErcValue(params string[] constants) {
     19      Name = "String constants";
    1920      array = new StringArray(constants);
    2021      Parameters.Add(new FixedValueParameter<StringArray>(ConstantsParameterName, array));
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/String/StringRandomErcValue.cs

    r14897 r14898  
    2828
    2929    public StringRandomErcValue() {
     30      Name = "String random";
    3031      Parameters.Add(new FixedValueParameter<BoolValue>(AllowLowercaseLettersParameterName, new BoolValue(true)));
    3132      Parameters.Add(new FixedValueParameter<BoolValue>(AllowUppercaseLettersParameterName, new BoolValue(true)));
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/StringVector/StringVectorConstantsErcValue.cs

    r14897 r14898  
    1717    private readonly StringArray[] arrays; // perf opt: avoid using parameter getter
    1818
     19    public StringVectorConstantsErcValue() : this(false, new StringArray[0]) { }
     20
    1921    public StringVectorConstantsErcValue(params StringArray[] arrays) : this(true, arrays) { }
    2022
    2123    public StringVectorConstantsErcValue(bool isEnabled, params StringArray[] arrays) {
    2224      this.arrays = arrays;
     25      Name = "String vector constants";
    2326      IsEnabled = isEnabled;
    24       Parameters.Add(new ValueParameter<ItemArray<StringArray>>(ConstantsParameterName, new ItemArray<StringArray>(arrays)));
     27      Parameters.Add(new ValueParameter<ItemCollection<StringArray>>(ConstantsParameterName, new ItemCollection<StringArray>(arrays)));
    2528    }
    2629
     
    3033    public StringVectorConstantsErcValue(StringVectorConstantsErcValue origin, Cloner cloner) : base(origin, cloner) { }
    3134
    32     public IValueParameter<ItemArray<StringArray>> ConstantsParameter
     35    public IValueParameter<ItemCollection<StringArray>> ConstantsParameter
    3336    {
    34       get { return (IValueParameter<ItemArray<StringArray>>)Parameters[ConstantsParameterName]; }
     37      get { return (IValueParameter<ItemCollection<StringArray>>)Parameters[ConstantsParameterName]; }
    3538    }
    3639
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/VectorConstantsErcValue.cs

    r14897 r14898  
    2222      this.arrays = arrays;
    2323      IsEnabled = isEnabled;
    24       Parameters.Add(new ValueParameter<ItemArray<TValue>>(ConstantsParameterName, new ItemArray<TValue>(arrays)));
     24      Parameters.Add(new ValueParameter<ItemCollection<TValue>>(ConstantsParameterName, new ItemCollection<TValue>(arrays)));
    2525    }
    2626
     
    3030    protected VectorConstantsErcValue(VectorConstantsErcValue<T, TValue> origin, Cloner cloner) : base(origin, cloner) { }
    3131
    32     public IValueParameter<ItemArray<TValue>> ConstantsParameter
     32    public IValueParameter<ItemCollection<TValue>> ConstantsParameter
    3333    {
    34       get { return (IValueParameter<ItemArray<TValue>>)Parameters[ConstantsParameterName]; }
     34      get { return (IValueParameter<ItemCollection<TValue>>)Parameters[ConstantsParameterName]; }
    3535    }
    3636
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/HeuristicLab.Problems.ProgramSynthesis.csproj

    r14897 r14898  
    189189    <Compile Include="Push\Generators\CodeGenerator\LinearCodeGenerator.cs" />
    190190    <Compile Include="Push\Generators\CodeGenerator\RecursiveCodeGenerator.cs" />
    191     <Compile Include="Push\Generators\ErcUtils.cs" />
    192191    <Compile Include="Push\Interpreter\Extensions.cs" />
    193192    <Compile Include="Push\Interpreter\IInternalPushInterpreter.cs" />
Note: See TracChangeset for help on using the changeset viewer.