Changeset 5736 for branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4
- Timestamp:
- 03/17/11 15:14:45 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SymbolicRegressionSolution.cs
r5733 r5736 39 39 [Item(Name = "SymbolicRegressionSolution", Description = "Represents a symbolic regression solution (model + data) and attributes of the solution like accuracy and complexity.")] 40 40 public sealed class SymbolicRegressionSolution : RegressionSolution, ISymbolicRegressionSolution { 41 private const string ModelLengthResultName = "ModelLength"; 42 private const string ModelDepthResultName = "ModelDepth"; 43 41 44 public new ISymbolicRegressionModel Model { 42 45 get { return (ISymbolicRegressionModel)base.Model; } … … 45 48 ISymbolicDataAnalysisModel ISymbolicDataAnalysisSolution.Model { 46 49 get { return (ISymbolicDataAnalysisModel)base.Model; } 50 } 51 public int ModelLength { 52 get { return ((IntValue)this[ModelLengthResultName].Value).Value; } 53 private set { ((IntValue)this[ModelLengthResultName].Value).Value = value; } 54 } 55 56 public int ModelDepth { 57 get { return ((IntValue)this[ModelDepthResultName].Value).Value; } 58 private set { ((IntValue)this[ModelDepthResultName].Value).Value = value; } 47 59 } 48 60 … … 54 66 public SymbolicRegressionSolution(ISymbolicRegressionModel model, IRegressionProblemData problemData) 55 67 : base(model, problemData) { 68 Add(new Result(ModelLengthResultName, "Length of the symbolic regression model.", new IntValue())); 69 Add(new Result(ModelDepthResultName, "Depth of the symbolic regression model.", new IntValue())); 70 RecalculateResults(); 56 71 } 57 72 58 73 public override IDeepCloneable Clone(Cloner cloner) { 59 74 return new SymbolicRegressionSolution(this, cloner); 75 } 76 77 protected override void OnModelChanged(EventArgs e) { 78 base.OnModelChanged(e); 79 RecalculateResults(); 80 } 81 82 private new void RecalculateResults() { 83 ModelLength = Model.SymbolicExpressionTree.Length; 84 ModelDepth = Model.SymbolicExpressionTree.Depth; 60 85 } 61 86
Note: See TracChangeset
for help on using the changeset viewer.