Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/28/17 22:52:08 (7 years ago)
Author:
pkimmesw
Message:

#2665 Dynamic ErcValues, Separate Push from BenchmarkSuite Push

File:
1 edited

Legend:

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

    r14875 r14897  
    11namespace HeuristicLab.Problems.ProgramSynthesis.Base.Erc {
    2   using Base.Erc.Interfaces;
    3   using Common;
    4   using Core;
    5   using Data;
    6   using Parameters;
    7   using Persistence.Default.CompositeSerializers.Storable;
     2  using HeuristicLab.Common;
     3  using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    84
    95  [StorableClass]
    10   public abstract class ErcOption : ParameterizedNamedItem, IReadOnlyErcOption {
    11     private const string IsEnabledParameterName = "IsEnabled";
     6  public abstract class ErcOption<T> : ErcOptionConvertible<T, T> {
     7    protected ErcOption() : this(false, new IWeightedErcValueItem<T>[0]) { }
    128
    13     protected ErcOption() {
    14       Parameters.Add(new FixedValueParameter<BoolValue>(IsEnabledParameterName));
     9    protected ErcOption(bool isEnabled, params IWeightedErcValueItem<T>[] values)
     10        : base(x => x, isEnabled, values) { }
     11
     12    [StorableConstructor]
     13    protected ErcOption(bool deserializing)
     14        : base(deserializing) {
    1515    }
    1616
    17     [StorableConstructor]
    18     protected ErcOption(bool deserializing) : base(deserializing) { }
    19 
    20     protected ErcOption(ErcOption origin, Cloner cloner) : base(origin, cloner) { }
    21 
    22     public IValueParameter<BoolValue> IsEnabledParameter
    23     {
    24       get { return (IValueParameter<BoolValue>)Parameters[IsEnabledParameterName]; }
    25     }
    26 
    27     public bool IsEnabled
    28     {
    29       get { return IsEnabledParameter.Value.Value; }
    30       set { IsEnabledParameter.Value.Value = value; }
     17    protected ErcOption(ErcOptionConvertible<T, T> origin, Cloner cloner)
     18        : base(origin, cloner) {
    3119    }
    3220  }
Note: See TracChangeset for help on using the changeset viewer.