Free cookie consent management tool by TermsFeed Policy Generator

Changeset 8990


Ignore:
Timestamp:
12/03/12 15:29:16 (12 years ago)
Author:
mkommend
Message:

#1763: Minor improvements and code simplification in symbolic data analysis simplifier.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs

    r8980 r8990  
    6464    protected override void OnContentChanged() {
    6565      base.OnContentChanged();
     66      replacementNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>();
     67
    6668      UpdateView();
    6769      viewHost.Content = this.Content;
     
    7173      if (Content == null || Content.Model == null || Content.ProblemData == null) return;
    7274      var tree = Content.Model.SymbolicExpressionTree;
     75      treeChart.Tree = tree.Root.SubtreeCount > 1 ? new SymbolicExpressionTree(tree.Root) : new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0));
    7376
    7477      var replacementValues = CalculateReplacementValues(tree);
     
    7881
    7982      nodeImpacts = CalculateImpactValues(tree);
    80 
    81       var model = Content.Model.SymbolicExpressionTree;
    82       treeChart.Tree = model.Root.SubtreeCount > 1 ? new SymbolicExpressionTree(model.Root) : new SymbolicExpressionTree(model.Root.GetSubtree(0).GetSubtree(0));
    8383      PaintNodeImpacts();
    8484    }
     
    101101      if (symbExprTreeNode == null) return;
    102102      if (!replacementNodes.ContainsKey(symbExprTreeNode)) return;
     103
    103104      var tree = Content.Model.SymbolicExpressionTree;
    104       var replacementNode = replacementNodes[symbExprTreeNode];
    105105      int indexOfReplacementNode = symbExprTreeNode.Parent.IndexOfSubtree(symbExprTreeNode);
    106106      SwitchNodeWithReplacementNode(symbExprTreeNode.Parent, indexOfReplacementNode);
    107       // show only interesting part of solution
    108       treeChart.Tree = tree.Root.SubtreeCount > 1
    109                          ? new SymbolicExpressionTree(tree.Root)
    110                          : new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0));
    111107      UpdateModel(tree);
    112       var vNode = treeChart.GetVisualSymbolicExpressionTreeNode(replacementNode);
    113       vNode.SymbolicExpressionTreeNode = replacementNode;
    114 
    115       vNode.LineColor = replacementNode is ConstantTreeNode ? Color.DarkOrange : Color.Black;
    116       treeChart.RepaintNode(vNode);
    117108    }
    118109
    119110    private void treeChart_SymbolicExpressionTreeChanged(object sender, EventArgs e) {
    120111      UpdateModel(Content.Model.SymbolicExpressionTree);
    121       UpdateView();
    122112    }
    123113
Note: See TracChangeset for help on using the changeset viewer.