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.Regression/3.4/SymbolicRegressionSolution.cs

    r5733 r5736  
    3939  [Item(Name = "SymbolicRegressionSolution", Description = "Represents a symbolic regression solution (model + data) and attributes of the solution like accuracy and complexity.")]
    4040  public sealed class SymbolicRegressionSolution : RegressionSolution, ISymbolicRegressionSolution {
     41    private const string ModelLengthResultName = "ModelLength";
     42    private const string ModelDepthResultName = "ModelDepth";
     43
    4144    public new ISymbolicRegressionModel Model {
    4245      get { return (ISymbolicRegressionModel)base.Model; }
     
    4548    ISymbolicDataAnalysisModel ISymbolicDataAnalysisSolution.Model {
    4649      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; }
    4759    }
    4860
     
    5466    public SymbolicRegressionSolution(ISymbolicRegressionModel model, IRegressionProblemData problemData)
    5567      : 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();
    5671    }
    5772
    5873    public override IDeepCloneable Clone(Cloner cloner) {
    5974      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;
    6085    }
    6186
Note: See TracChangeset for help on using the changeset viewer.