Changeset 7481 for branches/HeuristicLab.Crossovers/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
- Timestamp:
- 02/17/12 14:25:51 (13 years ago)
- Location:
- branches/HeuristicLab.Crossovers/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Crossovers/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SubtreeCrossover.cs
r7477 r7481 28 28 using HeuristicLab.Parameters; 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 using HeuristicLab.PluginInfrastructure;31 30 32 31 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding { … … 37 36 /// until a valid configuration is found. 38 37 /// </summary> 39 [Item("SubtreeCrossover", "An operator which performs subtree swapping crossover.")] 40 [NonDiscoverableType] 38 [Item("SubtreeSwappingCrossover", "An operator which performs subtree swapping crossover.")] 41 39 [StorableClass] 42 40 public class SubtreeCrossover : SymbolicExpressionTreeCrossover, ISymbolicExpressionTreeSizeConstraintOperator { … … 44 42 private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength"; 45 43 private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth"; 46 private const string SymbolicDataAnalysisEvaluationPartitionParameterName = "EvaluationPartition";47 44 48 45 #region Parameter Properties … … 55 52 public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeDepthParameter { 56 53 get { return (IValueLookupParameter<IntValue>)Parameters[MaximumSymbolicExpressionTreeDepthParameterName]; } 57 }58 public IValueLookupParameter<IntRange> SymbolicDataAnalysisEvaluationPartitionParameter {59 get { return (IValueLookupParameter<IntRange>)Parameters[SymbolicDataAnalysisEvaluationPartitionParameterName]; }60 54 } 61 55 #endregion … … 79 73 Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0).")); 80 74 Parameters.Add(new ValueLookupParameter<PercentValue>(InternalCrossoverPointProbabilityParameterName, "The probability to select an internal crossover point (instead of a leaf node).", new PercentValue(0.9))); 81 Parameters.Add(new ValueLookupParameter<IntRange>(SymbolicDataAnalysisEvaluationPartitionParameterName, "The start index of the dataset partition on which the symbolic data analysis solution should be evaluated."));82 75 } 83 76 … … 86 79 } 87 80 88 p rotected override ISymbolicExpressionTree Cross(IRandom random,81 public override ISymbolicExpressionTree Crossover(IRandom random, 89 82 ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) { 90 83 return Cross(random, parent0, parent1, InternalCrossoverPointProbability.Value, 91 84 MaximumSymbolicExpressionTreeLength.Value, MaximumSymbolicExpressionTreeDepth.Value); 92 }93 94 public ISymbolicExpressionTree Crossover(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1) {95 return Cross(random, parent0, parent1);96 85 } 97 86 -
branches/HeuristicLab.Crossovers/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SymbolicExpressionTreeCrossover.cs
r7259 r7481 23 23 using HeuristicLab.Common; 24 24 using HeuristicLab.Core; 25 using HeuristicLab.Data;26 25 using HeuristicLab.Parameters; 27 26 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 66 65 throw new ArgumentException("Number of parents must be exactly two for symbolic expression tree crossover operators."); 67 66 68 ISymbolicExpressionTree result = Cross (Random, Parents[0], Parents[1]);67 ISymbolicExpressionTree result = Crossover(Random, Parents[0], Parents[1]); 69 68 70 69 Child = result; … … 72 71 } 73 72 74 protected abstract ISymbolicExpressionTree Cross(IRandom random, 75 ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1); 73 public abstract ISymbolicExpressionTree Crossover(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1); 76 74 } 77 75 } -
branches/HeuristicLab.Crossovers/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Interfaces/Operators/ISymbolicExpressionTreeCrossover.cs
r7259 r7481 30 30 ILookupParameter<ItemArray<ISymbolicExpressionTree>> ParentsParameter { get; } 31 31 ILookupParameter<ISymbolicExpressionTree> ChildParameter { get; } 32 ISymbolicExpressionTree Crossover(IRandom random, ISymbolicExpressionTree parent0, ISymbolicExpressionTree parent1); 32 33 } 33 34 }
Note: See TracChangeset
for help on using the changeset viewer.