Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/15/12 16:47:25 (11 years ago)
Author:
mkommend
Message:

#1763: merged changes from trunk into the tree simplifier branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs

    r8175 r8915  
    3636    private const string EstimationLimitsParameterName = "EstimationLimits";
    3737    private const string EstimationLimitsParameterDescription = "The lower and upper limit for the estimated value that can be returned by the symbolic classification model.";
     38    private const string ModelCreatorParameterName = "ModelCreator";
     39
    3840
    3941    #region parameter properties
     
    4143      get { return (IFixedValueParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; }
    4244    }
     45    public IValueParameter<ISymbolicClassificationModelCreator> ModelCreatorParameter {
     46      get { return (IValueParameter<ISymbolicClassificationModelCreator>)Parameters[ModelCreatorParameterName]; }
     47    }
    4348    #endregion
    4449    #region properties
    4550    public DoubleLimit EstimationLimits {
    4651      get { return EstimationLimitsParameter.Value; }
     52    }
     53    public ISymbolicClassificationModelCreator ModelCreator {
     54      get { return ModelCreatorParameter.Value; }
    4755    }
    4856    #endregion
     
    5866      : base(new ClassificationProblemData(), new SymbolicClassificationMultiObjectiveMeanSquaredErrorTreeSizeEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) {
    5967      Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription));
     68      Parameters.Add(new ValueParameter<ISymbolicClassificationModelCreator>(ModelCreatorParameterName, "", new AccuracyMaximizingThresholdsModelCreator()));
    6069
     70      ApplyLinearScalingParameter.Value.Value = false;
    6171      EstimationLimitsParameter.Hidden = true;
    6272
     
    7484    [StorableHook(HookType.AfterDeserialization)]
    7585    private void AfterDeserialization() {
     86      // BackwardsCompatibility3.4
     87      #region Backwards compatible code, remove with 3.5
     88      if (!Parameters.ContainsKey(ModelCreatorParameterName))
     89        Parameters.Add(new ValueParameter<ISymbolicClassificationModelCreator>(ModelCreatorParameterName, "", new AccuracyMaximizingThresholdsModelCreator()));
     90      #endregion
    7691      RegisterEventHandlers();
    7792    }
     
    7994    private void RegisterEventHandlers() {
    8095      SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols();
     96      ModelCreatorParameter.NameChanged += (o, e) => ParameterizeOperators();
    8197    }
    8298
     
    110126    }
    111127
    112     protected new void ParameterizeOperators() {
     128    protected override void ParameterizeOperators() {
    113129      base.ParameterizeOperators();
    114130      if (Parameters.ContainsKey(EstimationLimitsParameterName)) {
    115131        var operators = Parameters.OfType<IValueParameter>().Select(p => p.Value).OfType<IOperator>().Union(Operators);
    116         foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>()) {
    117           op.EstimationLimitsParameter.ActualName = EstimationLimitsParameterName;
    118         }
     132        foreach (var op in operators.OfType<ISymbolicDataAnalysisBoundedOperator>())
     133          op.EstimationLimitsParameter.ActualName = EstimationLimitsParameter.Name;
     134        foreach (var op in operators.OfType<ISymbolicClassificationModelCreatorOperator>())
     135          op.ModelCreatorParameter.ActualName = ModelCreatorParameter.Name;
    119136      }
    120137    }
Note: See TracChangeset for help on using the changeset viewer.