Changeset 12266 for branches/SymbolicExpressionTreeEncoding
- Timestamp:
- 03/30/15 12:28:56 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SymbolicExpressionTreeEncoding/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeEncoding.cs
r12196 r12266 51 51 treeLengthParameter = value; 52 52 Parameters.Add(treeLengthParameter); 53 OnLengthParameterChanged(); 53 54 } 54 55 } … … 68 69 treeDepthParameter = value; 69 70 Parameters.Add(treeDepthParameter); 71 OnDepthParameterChanged(); 70 72 } 71 73 } … … 75 77 [StorableConstructor] 76 78 public SymbolicExpressionTreeEncoding(bool deserializing) : base(deserializing) { } 77 78 public SymbolicExpressionTreeEncoding(Encoding<ISymbolicExpressionTreeCreator> original, Cloner cloner)79 : base(original, cloner) {80 }81 82 79 public SymbolicExpressionTreeEncoding() : this("SymbolicExpressionTree") { } 83 80 public SymbolicExpressionTreeEncoding(string name) : base(name) { } … … 85 82 private SymbolicExpressionTreeEncoding(SymbolicExpressionTreeEncoding original, Cloner cloner) 86 83 : base(original, cloner) { 84 TreeLengthParameter = cloner.Clone(original.TreeLengthParameter); 85 TreeDepthParameter = cloner.Clone(original.TreeDepthParameter); 87 86 } 88 87 … … 91 90 } 92 91 93 public override void ConfigureOperators(IEnumerable<IOperator> operators) { 94 ConfigureCreators(operators.OfType<ISymbolicExpressionTreeCreator>()); 95 ConfigureCrossovers(operators.OfType<ISymbolicExpressionTreeCrossover>()); 96 ConfigureManipulators(operators.OfType<ISymbolicExpressionTreeManipulator>()); 97 } 92 98 93 99 94 private void OnLengthParameterChanged() { … … 105 100 RegisterDepthParameterEvents(); 106 101 ConfigureOperators(Operators); 102 } 103 104 private void RegisterEvents() { 105 RegisterLengthParameterEvents(); 106 RegisterLengthParameterEvents(); 107 107 } 108 108 … … 119 119 #region Operator discovery 120 120 private static readonly IEnumerable<Type> encodingSpecificOperatorTypes; 121 122 121 static SymbolicExpressionTreeEncoding() { 123 122 encodingSpecificOperatorTypes = new List<Type> … … 143 142 144 143 #region Specific operator wiring 144 145 public override void ConfigureOperators(IEnumerable<IOperator> operators) { 146 ConfigureCreators(operators.OfType<ISymbolicExpressionTreeCreator>()); 147 ConfigureCrossovers(operators.OfType<ISymbolicExpressionTreeCrossover>()); 148 ConfigureManipulators(operators.OfType<ISymbolicExpressionTreeManipulator>()); 149 } 150 145 151 private void ConfigureCreators(IEnumerable<ISymbolicExpressionTreeCreator> creators) { 146 152 foreach (var creator in creators) {
Note: See TracChangeset
for help on using the changeset viewer.