Changeset 12706 for stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/MultiSymbolicDataAnalysisExpressionCrossover.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.Problems.DataAnalysis.Symbolic
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/MultiSymbolicDataAnalysisExpressionCrossover.cs
r12009 r12706 35 35 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 36 36 [Item("MultiSymbolicDataAnalysisExpressionCrossover", "Randomly selects and applies one of its crossovers every time it is called.")] 37 [StorableClass] 37 38 public class MultiSymbolicDataAnalysisExpressionCrossover<T> : StochasticMultiBranch<ISymbolicExpressionTreeCrossover>, 38 39 ISymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData { 39 40 private const string ParentsParameterName = "Parents"; 40 private const string ChildParameterName = "Child";41 private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree"; 41 42 private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength"; 42 43 private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth"; … … 62 63 get { return (ScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[ParentsParameterName]; } 63 64 } 64 public ILookupParameter<ISymbolicExpressionTree> ChildParameter {65 get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[ ChildParameterName]; }65 public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter { 66 get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; } 66 67 } 67 68 public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter { … … 99 100 Parameters.Add(new ValueLookupParameter<IntRange>(SymbolicDataAnalysisEvaluationPartitionParameterName, "The start index of the dataset partition on which the symbolic data analysis solution should be evaluated.")); 100 101 Parameters.Add(new ScopeTreeLookupParameter<ISymbolicExpressionTree>(ParentsParameterName, "The parent symbolic expression trees which should be crossed.")); 101 Parameters.Add(new LookupParameter<ISymbolicExpressionTree>( ChildParameterName, "The child symbolic expression tree resulting from the crossover."));102 Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The child symbolic expression tree resulting from the crossover.")); 102 103 103 104 EvaluatorParameter.Hidden = true; … … 111 112 112 113 SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator"; 114 } 115 116 [StorableHook(HookType.AfterDeserialization)] 117 private void AfterDeserialization() { 118 // BackwardsCompatibility3.3 119 #region Backwards compatible code, remove with 3.4 120 if (!Parameters.ContainsKey(SymbolicExpressionTreeParameterName)) 121 Parameters.Add(new LookupParameter<ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied.")); 122 #endregion 113 123 } 114 124 … … 155 165 private void ParameterizeCrossovers() { 156 166 foreach (ISymbolicExpressionTreeCrossover op in Operators) { 157 op. ChildParameter.ActualName = ChildParameter.Name;167 op.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name; 158 168 op.ParentsParameter.ActualName = ParentsParameter.Name; 159 169 }
Note: See TracChangeset
for help on using the changeset viewer.