Changeset 8915 for branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs
- Timestamp:
- 11/15/12 16:47:25 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.TreeSimplifier/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveProblem.cs
r8175 r8915 36 36 private const string EstimationLimitsParameterName = "EstimationLimits"; 37 37 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 38 40 39 41 #region parameter properties … … 41 43 get { return (IFixedValueParameter<DoubleLimit>)Parameters[EstimationLimitsParameterName]; } 42 44 } 45 public IValueParameter<ISymbolicClassificationModelCreator> ModelCreatorParameter { 46 get { return (IValueParameter<ISymbolicClassificationModelCreator>)Parameters[ModelCreatorParameterName]; } 47 } 43 48 #endregion 44 49 #region properties 45 50 public DoubleLimit EstimationLimits { 46 51 get { return EstimationLimitsParameter.Value; } 52 } 53 public ISymbolicClassificationModelCreator ModelCreator { 54 get { return ModelCreatorParameter.Value; } 47 55 } 48 56 #endregion … … 58 66 : base(new ClassificationProblemData(), new SymbolicClassificationMultiObjectiveMeanSquaredErrorTreeSizeEvaluator(), new SymbolicDataAnalysisExpressionTreeCreator()) { 59 67 Parameters.Add(new FixedValueParameter<DoubleLimit>(EstimationLimitsParameterName, EstimationLimitsParameterDescription)); 68 Parameters.Add(new ValueParameter<ISymbolicClassificationModelCreator>(ModelCreatorParameterName, "", new AccuracyMaximizingThresholdsModelCreator())); 60 69 70 ApplyLinearScalingParameter.Value.Value = false; 61 71 EstimationLimitsParameter.Hidden = true; 62 72 … … 74 84 [StorableHook(HookType.AfterDeserialization)] 75 85 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 76 91 RegisterEventHandlers(); 77 92 } … … 79 94 private void RegisterEventHandlers() { 80 95 SymbolicExpressionTreeGrammarParameter.ValueChanged += (o, e) => ConfigureGrammarSymbols(); 96 ModelCreatorParameter.NameChanged += (o, e) => ParameterizeOperators(); 81 97 } 82 98 … … 110 126 } 111 127 112 protected newvoid ParameterizeOperators() {128 protected override void ParameterizeOperators() { 113 129 base.ParameterizeOperators(); 114 130 if (Parameters.ContainsKey(EstimationLimitsParameterName)) { 115 131 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; 119 136 } 120 137 }
Note: See TracChangeset
for help on using the changeset viewer.