Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/12/14 14:14:33 (8 years ago)
Author:
pfleck
Message:
  • Cloned Model before backtransformation.
  • Set new Model instead of whole Solution after backtransformation.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DataPreprocessing/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression.Views/3.4/SymbolicRegressionSolutionView.cs

    r11009 r11011  
    4848
    4949    private void btn_SimplifyModel_Click(object sender, EventArgs e) {
    50       InteractiveSymbolicRegressionSolutionSimplifierView view = new InteractiveSymbolicRegressionSolutionSimplifierView();
     50      var view = new InteractiveSymbolicRegressionSolutionSimplifierView();
    5151      view.Content = (SymbolicRegressionSolution)this.Content.Clone();
    5252      view.Show();
     
    7070      var mapper = new TransformationToSymbolicTreeMapper();
    7171      var transformator = new SymbolicExpressionTreeBacktransformator(mapper);
     72
    7273      var transformations = Content.ProblemData.Transformations;
    7374      var targetVar = Content.ProblemData.TargetVariable;
    74       transformator.Backtransform(Content.Model, transformations, targetVar);
    75       // TODO: cloning is needed for refreshing the view, find a better approach for this.
    76       Content = (SymbolicRegressionSolution)Content.Clone();
     75      var newModel = transformator.Backtransform(Content.Model, transformations, targetVar);
     76      Content.Model = (ISymbolicRegressionModel)newModel;
     77
    7778      MessageBox.Show(this, "Backtransformation successful.");
    7879    }
Note: See TracChangeset for help on using the changeset viewer.