Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/10/15 11:29:34 (9 years ago)
Author:
mkommend
Message:

#2320: Merged the encoding class and all accompanying changes in the trunk.

Location:
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding

  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeOperator.cs

    r12012 r12422  
    2222using HeuristicLab.Common;
    2323using HeuristicLab.Core;
    24 using HeuristicLab.Data;
    2524using HeuristicLab.Operators;
    2625using HeuristicLab.Optimization;
     
    3635  public abstract class SymbolicExpressionTreeOperator : InstrumentedOperator, IStochasticOperator, ISymbolicExpressionTreeOperator {
    3736    private const string RandomParameterName = "Random";
     37    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
    3838
    3939    public override bool CanChangeName {
     
    4545      get { return (LookupParameter<IRandom>)Parameters[RandomParameterName]; }
    4646    }
    47     #endregion
    48 
    49     #region Properties
    50     public IRandom Random {
    51       get { return RandomParameter.ActualValue; }
     47    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
     48      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
    5249    }
    5350    #endregion
     
    5956      : base() {
    6057      Parameters.Add(new LookupParameter<IRandom>(RandomParameterName, "The pseudo random number generator which should be used for symbolic expression tree operators."));
     58      Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
     59    }
     60
     61    [StorableHook(HookType.AfterDeserialization)]
     62    private void AfterDeserialization() {
     63      // BackwardsCompatibility3.3
     64      #region Backwards compatible code, remove with 3.4
     65      if (!Parameters.ContainsKey(SymbolicExpressionTreeParameterName))
     66        Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
     67      #endregion
    6168    }
    6269  }
Note: See TracChangeset for help on using the changeset viewer.