Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/21/10 15:21:34 (15 years ago)
Author:
gkronber
Message:

Refactored symbolic expression tree encoding and problem classes for symbolic regression. #937 , #938

Location:
trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SimplifiedSymbolicExpressionModelView.cs

    r3461 r3462  
    4444    public new SymbolicRegressionSolution Content {
    4545      get { return (SymbolicRegressionSolution)base.Content; }
    46       set {        base.Content = value;      }
     46      set { base.Content = value; }
    4747    }
    4848
     
    5858    }
    5959
     60    protected override void RegisterContentEvents() {
     61      base.RegisterContentEvents();
     62      Content.ModelChanged += new EventHandler(Content_ModelChanged);
     63    }
     64
     65    protected override void DeregisterContentEvents() {
     66      base.DeregisterContentEvents();
     67      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
     68    }
     69
     70    void Content_ModelChanged(object sender, EventArgs e) {
     71      UpdateTreeChart();
     72    }
     73
    6074    protected override void OnContentChanged() {
    6175      base.OnContentChanged();
     76      UpdateTreeChart();
     77    }
     78
     79    private void UpdateTreeChart() {
    6280      var simplifier = new SymbolicSimplifier();
    6381      var simplifiedTree = simplifier.Simplify(Content.Model.SymbolicExpressionTree);
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Views/3.3/Symbolic/SymbolicExpressionModelView.cs

    r3461 r3462  
    5757    }
    5858
     59
     60    protected override void RegisterContentEvents() {
     61      base.RegisterContentEvents();
     62      Content.ModelChanged += new EventHandler(Content_ModelChanged);
     63    }
     64
     65    protected override void DeregisterContentEvents() {
     66      base.DeregisterContentEvents();
     67      Content.ModelChanged -= new EventHandler(Content_ModelChanged);
     68    }
     69
     70    void Content_ModelChanged(object sender, EventArgs e) {
     71      UpdateTreeChart();
     72    }
     73
    5974    protected override void OnContentChanged() {
    6075      base.OnContentChanged();
     76      UpdateTreeChart();
     77    }
     78
     79    private void UpdateTreeChart() {
    6180      viewHost.Content = Content.Model.SymbolicExpressionTree;
    6281    }
Note: See TracChangeset for help on using the changeset viewer.