Changeset 5736 for branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationSolution.cs
- Timestamp:
- 03/17/11 15:14:45 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationSolution.cs
r5717 r5736 39 39 [Item(Name = "SymbolicClassificationSolution", Description = "Represents a symbolic classification solution (model + data) and attributes of the solution like accuracy and complexity.")] 40 40 public sealed class SymbolicClassificationSolution : ClassificationSolution, ISymbolicClassificationSolution { 41 #region ISymbolicClassificationSolution Members 41 private const string ModelLengthResultName = "ModelLength"; 42 private const string ModelDepthResultName = "ModelDepth"; 42 43 43 44 public new ISymbolicClassificationModel Model { … … 49 50 get { return (ISymbolicDataAnalysisModel)base.Model; } 50 51 } 52 public int ModelLength { 53 get { return ((IntValue)this[ModelLengthResultName].Value).Value; } 54 private set { ((IntValue)this[ModelLengthResultName].Value).Value = value; } 55 } 51 56 52 #endregion 57 public int ModelDepth { 58 get { return ((IntValue)this[ModelDepthResultName].Value).Value; } 59 private set { ((IntValue)this[ModelDepthResultName].Value).Value = value; } 60 } 61 53 62 [StorableConstructor] 54 63 private SymbolicClassificationSolution(bool deserializing) : base(deserializing) { } … … 58 67 public SymbolicClassificationSolution(ISymbolicClassificationModel model, IClassificationProblemData problemData) 59 68 : base(model, problemData) { 69 Add(new Result(ModelLengthResultName, "Length of the symbolic classification model.", new IntValue())); 70 Add(new Result(ModelDepthResultName, "Depth of the symbolic classification model.", new IntValue())); 71 RecalculateResults(); 60 72 } 61 73 … … 63 75 return new SymbolicClassificationSolution(this, cloner); 64 76 } 77 78 protected override void OnModelChanged(EventArgs e) { 79 base.OnModelChanged(e); 80 RecalculateResults(); 81 } 82 83 private new void RecalculateResults() { 84 ModelLength = Model.SymbolicExpressionTree.Length; 85 ModelDepth = Model.SymbolicExpressionTree.Depth; 86 } 65 87 } 66 88 }
Note: See TracChangeset
for help on using the changeset viewer.