Changeset 12314 for branches/SymbolicExpressionTreeEncoding/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers
- Timestamp:
- 04/14/15 15:31:02 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SymbolicExpressionTreeEncoding/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SymbolicExpressionTreeCrossover.cs
r12012 r12314 34 34 public abstract class SymbolicExpressionTreeCrossover : SymbolicExpressionTreeOperator, ISymbolicExpressionTreeCrossover { 35 35 private const string ParentsParameterName = "Parents"; 36 private const string ChildParameterName = "Child";37 36 #region Parameter Properties 38 37 public ILookupParameter<ItemArray<ISymbolicExpressionTree>> ParentsParameter { 39 38 get { return (ScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[ParentsParameterName]; } 40 39 } 41 public ILookupParameter<ISymbolicExpressionTree> ChildParameter {42 get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[ChildParameterName]; }43 }44 40 #endregion 45 41 #region Properties 46 p ublicItemArray<ISymbolicExpressionTree> Parents {42 private ItemArray<ISymbolicExpressionTree> Parents { 47 43 get { return ParentsParameter.ActualValue; } 48 44 } 49 p ublicISymbolicExpressionTree Child {50 get { return ChildParameter.ActualValue; }51 set { ChildParameter.ActualValue = value; }45 private ISymbolicExpressionTree Child { 46 get { return SymbolicExpressionTreeParameter.ActualValue; } 47 set { SymbolicExpressionTreeParameter.ActualValue = value; } 52 48 } 53 49 #endregion … … 58 54 : base() { 59 55 Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(ParentsParameterName, "The parent symbolic expression trees which should be crossed.")); 60 Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(ChildParameterName, "The child symbolic expression tree resulting from the crossover."));61 56 ParentsParameter.ActualName = "SymbolicExpressionTree"; 62 ChildParameter.ActualName = "SymbolicExpressionTree";63 57 } 64 58 … … 67 61 throw new ArgumentException("Number of parents must be exactly two for symbolic expression tree crossover operators."); 68 62 69 ISymbolicExpressionTree result = Crossover(Random , Parents[0], Parents[1]);63 ISymbolicExpressionTree result = Crossover(RandomParameter.ActualValue, Parents[0], Parents[1]); 70 64 71 65 Child = result;
Note: See TracChangeset
for help on using the changeset viewer.