Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/17/11 15:14:45 (13 years ago)
Author:
gkronber
Message:

#1418 implemented linear scaling for classification solutions, fixed bugs interactive simplifier view for classification solutions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataAnalysis Refactoring/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SymbolicClassificationSolution.cs

    r5717 r5736  
    3939  [Item(Name = "SymbolicClassificationSolution", Description = "Represents a symbolic classification solution (model + data) and attributes of the solution like accuracy and complexity.")]
    4040  public sealed class SymbolicClassificationSolution : ClassificationSolution, ISymbolicClassificationSolution {
    41     #region ISymbolicClassificationSolution Members
     41    private const string ModelLengthResultName = "ModelLength";
     42    private const string ModelDepthResultName = "ModelDepth";
    4243
    4344    public new ISymbolicClassificationModel Model {
     
    4950      get { return (ISymbolicDataAnalysisModel)base.Model; }
    5051    }
     52    public int ModelLength {
     53      get { return ((IntValue)this[ModelLengthResultName].Value).Value; }
     54      private set { ((IntValue)this[ModelLengthResultName].Value).Value = value; }
     55    }
    5156
    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
    5362    [StorableConstructor]
    5463    private SymbolicClassificationSolution(bool deserializing) : base(deserializing) { }
     
    5867    public SymbolicClassificationSolution(ISymbolicClassificationModel model, IClassificationProblemData problemData)
    5968      : 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();
    6072    }
    6173
     
    6375      return new SymbolicClassificationSolution(this, cloner);
    6476    }
     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    }
    6587  }
    6688}
Note: See TracChangeset for help on using the changeset viewer.