Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/02/17 20:42:40 (7 years ago)
Author:
pkimmesw
Message:

#2665 Made ErcOptions checkable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis.Base/Erc/VectorConstantsErcValue.cs

    r14898 r14905  
    1515    private const string ConstantsParameterName = "Constants";
    1616
    17     private readonly TValue[] arrays; // perf opt: avoid using parameter getter
     17    protected VectorConstantsErcValue(params TValue[] arrays) : this(true, 1d, arrays) { }
    1818
    19     protected VectorConstantsErcValue(params TValue[] arrays) : this(true, arrays) { }
    20 
    21     protected VectorConstantsErcValue(bool isEnabled, params TValue[] arrays) {
    22       this.arrays = arrays;
     19    protected VectorConstantsErcValue(bool isEnabled, double weight = 1d, params TValue[] arrays) : base(isEnabled, weight) {
    2320      IsEnabled = isEnabled;
    2421      Parameters.Add(new ValueParameter<ItemCollection<TValue>>(ConstantsParameterName, new ItemCollection<TValue>(arrays)));
     
    4239    public override IReadOnlyList<T> GetErcValue(IRandom random) {
    4340      // TODO: remove ToList when ValueTypeArray implements IReadOnlyList
    44       return arrays.SampleRandom(random).ToList();
     41      return Constants.SampleRandom(random).ToArray();
    4542    }
    4643  }
Note: See TracChangeset for help on using the changeset viewer.