Changeset 12706 for stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeOperator.cs
- Timestamp:
- 07/10/15 12:02:20 (9 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 12422,12424,12480-12482
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeOperator.cs
r12009 r12706 22 22 using HeuristicLab.Common; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 24 using HeuristicLab.Operators; 26 25 using HeuristicLab.Optimization; … … 36 35 public abstract class SymbolicExpressionTreeOperator : InstrumentedOperator, IStochasticOperator, ISymbolicExpressionTreeOperator { 37 36 private const string RandomParameterName = "Random"; 37 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; 38 38 39 39 public override bool CanChangeName { … … 45 45 get { return (LookupParameter<IRandom>)Parameters[RandomParameterName]; } 46 46 } 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]; } 52 49 } 53 50 #endregion … … 59 56 : base() { 60 57 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 61 68 } 62 69 }
Note: See TracChangeset
for help on using the changeset viewer.