Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/10/15 12:02:20 (9 years ago)
Author:
mkommend
Message:

#2320: Merged r12422, r12423, r12424, r12480, r12481 and r12482 into stable.

Location:
stable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • stable

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic

  • stable/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Crossovers/MultiSymbolicDataAnalysisExpressionCrossover.cs

    r12009 r12706  
    3535namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
    3636  [Item("MultiSymbolicDataAnalysisExpressionCrossover", "Randomly selects and applies one of its crossovers every time it is called.")]
     37  [StorableClass]
    3738  public class MultiSymbolicDataAnalysisExpressionCrossover<T> : StochasticMultiBranch<ISymbolicExpressionTreeCrossover>,
    3839    ISymbolicDataAnalysisExpressionCrossover<T> where T : class, IDataAnalysisProblemData {
    3940    private const string ParentsParameterName = "Parents";
    40     private const string ChildParameterName = "Child";
     41    private const string SymbolicExpressionTreeParameterName = "SymbolicExpressionTree";
    4142    private const string MaximumSymbolicExpressionTreeLengthParameterName = "MaximumSymbolicExpressionTreeLength";
    4243    private const string MaximumSymbolicExpressionTreeDepthParameterName = "MaximumSymbolicExpressionTreeDepth";
     
    6263      get { return (ScopeTreeLookupParameter<ISymbolicExpressionTree>)Parameters[ParentsParameterName]; }
    6364    }
    64     public ILookupParameter<ISymbolicExpressionTree> ChildParameter {
    65       get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[ChildParameterName]; }
     65    public ILookupParameter<ISymbolicExpressionTree> SymbolicExpressionTreeParameter {
     66      get { return (ILookupParameter<ISymbolicExpressionTree>)Parameters[SymbolicExpressionTreeParameterName]; }
    6667    }
    6768    public IValueLookupParameter<IntValue> MaximumSymbolicExpressionTreeLengthParameter {
     
    99100      Parameters.Add(new ValueLookupParameter<IntRange>(SymbolicDataAnalysisEvaluationPartitionParameterName, "The start index of the dataset partition on which the symbolic data analysis solution should be evaluated."));
    100101      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."));
    102103
    103104      EvaluatorParameter.Hidden = true;
     
    111112
    112113      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
    113123    }
    114124
     
    155165    private void ParameterizeCrossovers() {
    156166      foreach (ISymbolicExpressionTreeCrossover op in Operators) {
    157         op.ChildParameter.ActualName = ChildParameter.Name;
     167        op.SymbolicExpressionTreeParameter.ActualName = SymbolicExpressionTreeParameter.Name;
    158168        op.ParentsParameter.ActualName = ParentsParameter.Name;
    159169      }
Note: See TracChangeset for help on using the changeset viewer.