- Timestamp:
- 05/05/10 00:48:18 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/BestValidationSymbolicRegressionSolutionVisualizer.cs
r3549 r3616 42 42 [Item("BestSymbolicExpressionTreeVisualizer", "An operator for visualizing the best symbolic regression solution based on the validation set.")] 43 43 [StorableClass] 44 public sealed class BestValidationSymbolicRegressionSolutionVisualizer : SingleSuccessorOperator, I SingleObjectiveSolutionsVisualizer, ISolutionsVisualizer {44 public sealed class BestValidationSymbolicRegressionSolutionVisualizer : SingleSuccessorOperator, IAnalyzer { 45 45 private const string SymbolicExpressionTreeInterpreterParameterName = "SymbolicExpressionTreeInterpreter"; 46 46 private const string UpperEstimationLimitParameterName = "UpperEstimationLimit"; … … 88 88 public ILookupParameter<SymbolicRegressionSolution> BestValidationSolutionParameter { 89 89 get { return (ILookupParameter<SymbolicRegressionSolution>)Parameters[BestValidationSolutionParameterName]; } 90 }91 ILookupParameter ISolutionsVisualizer.VisualizationParameter {92 get { return BestValidationSolutionParameter; }93 90 } 94 91 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionProblem.cs
r3599 r3616 89 89 get { return (ValueParameter<IntValue>)Parameters["MaxFunctionArguments"]; } 90 90 } 91 public OptionalValueParameter<ISingleObjectiveSolutionsVisualizer> VisualizerParameter {92 get { return (OptionalValueParameter<ISingleObjectiveSolutionsVisualizer>)Parameters["Visualizer"]; }93 }94 IParameter IProblem.VisualizerParameter {95 get { return VisualizerParameter; }96 }97 91 public OptionalValueParameter<DoubleValue> BestKnownQualityParameter { 98 92 get { return (OptionalValueParameter<DoubleValue>)Parameters["BestKnownQuality"]; } … … 152 146 public ISymbolicExpressionGrammar FunctionTreeGrammar { 153 147 get { return (ISymbolicExpressionGrammar)FunctionTreeGrammarParameter.Value; } 154 }155 public ISingleObjectiveSolutionsVisualizer Visualizer {156 get { return VisualizerParameter.Value; }157 set { VisualizerParameter.Value = value; }158 }159 ISolutionsVisualizer IProblem.Visualizer {160 get { return VisualizerParameter.Value; }161 148 } 162 149 public DoubleValue BestKnownQuality { … … 207 194 Parameters.Add(new ValueParameter<IntValue>("MaxFunctionDefiningBranches", "Maximal number of automatically defined functions.", (IntValue)new IntValue(0).AsReadOnly())); 208 195 Parameters.Add(new ValueParameter<IntValue>("MaxFunctionArguments", "Maximal number of arguments of automatically defined functions.", (IntValue)new IntValue(0).AsReadOnly())); 209 Parameters.Add(new ValueParameter<ISingleObjectiveSolutionsVisualizer>("Visualizer", "The operator which should be used to visualize symbolic regression solutions.", visualizer));210 196 211 197 creator.SymbolicExpressionTreeParameter.ActualName = "SymbolicRegressionModel"; … … 240 226 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 241 227 EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged); 242 VisualizerParameter.ValueChanged += new EventHandler(VisualizerParameter_ValueChanged);243 228 } 244 229 … … 288 273 ParameterizeVisualizer(); 289 274 } 290 protected virtual void OnVisualizerChanged(EventArgs e) {291 ParameterizeVisualizer();292 RaiseVisualizerChanged(e);293 }294 275 #endregion 295 276 … … 303 284 private void EvaluatorParameter_ValueChanged(object sender, EventArgs e) { 304 285 OnEvaluatorChanged(e); 305 }306 private void VisualizerParameter_ValueChanged(object sender, EventArgs e) {307 OnVisualizerChanged(e);308 286 } 309 287 private void ArchitectureParameter_ValueChanged(object sender, EventArgs e) { … … 325 303 private void RaiseEvaluatorChanged(EventArgs e) { 326 304 var changed = EvaluatorChanged; 327 if (changed != null)328 changed(this, e);329 }330 public event EventHandler VisualizerChanged;331 private void RaiseVisualizerChanged(EventArgs e) {332 var changed = VisualizerChanged;333 305 if (changed != null) 334 306 changed(this, e); … … 394 366 395 367 private void ParameterizeVisualizer() { 396 var solutionVisualizer = Visualizer as BestValidationSymbolicRegressionSolutionVisualizer;397 if (solutionVisualizer != null) {398 solutionVisualizer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName;399 solutionVisualizer.DataAnalysisProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name;400 solutionVisualizer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name;401 solutionVisualizer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name;402 solutionVisualizer.QualityParameter.ActualName = Evaluator.QualityParameter.Name;403 solutionVisualizer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name;404 solutionVisualizer.ValidationSamplesStartParameter.Value = ValidationSamplesStart;405 solutionVisualizer.ValidationSamplesEndParameter.Value = ValidationSamplesEnd;406 }368 //var solutionVisualizer = Visualizer as BestValidationSymbolicRegressionSolutionVisualizer; 369 //if (solutionVisualizer != null) { 370 // solutionVisualizer.SymbolicExpressionTreeParameter.ActualName = SolutionCreator.SymbolicExpressionTreeParameter.ActualName; 371 // solutionVisualizer.DataAnalysisProblemDataParameter.ActualName = DataAnalysisProblemDataParameter.Name; 372 // solutionVisualizer.UpperEstimationLimitParameter.ActualName = UpperEstimationLimitParameter.Name; 373 // solutionVisualizer.LowerEstimationLimitParameter.ActualName = LowerEstimationLimitParameter.Name; 374 // solutionVisualizer.QualityParameter.ActualName = Evaluator.QualityParameter.Name; 375 // solutionVisualizer.SymbolicExpressionTreeInterpreterParameter.ActualName = SymbolicExpressionTreeInterpreterParameter.Name; 376 // solutionVisualizer.ValidationSamplesStartParameter.Value = ValidationSamplesStart; 377 // solutionVisualizer.ValidationSamplesEndParameter.Value = ValidationSamplesEnd; 378 //} 407 379 } 408 380
Note: See TracChangeset
for help on using the changeset viewer.