Changeset 10681 for branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
- Timestamp:
- 03/31/14 13:38:42 (11 years ago)
- Location:
- branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views merged: 10492,10521-10522,10545,10561,10564
- Property svn:mergeinfo changed
-
branches/Sliding Window GP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r9708 r10681 52 52 Content.ModelChanged += Content_Changed; 53 53 Content.ProblemDataChanged += Content_Changed; 54 treeChart.Repainted += treeChart_Repainted; 54 55 } 55 56 protected override void DeregisterContentEvents() { … … 57 58 Content.ModelChanged -= Content_Changed; 58 59 Content.ProblemDataChanged -= Content_Changed; 60 treeChart.Repainted -= treeChart_Repainted; 59 61 } 60 62 … … 70 72 } 71 73 74 private void treeChart_Repainted(object sender, EventArgs e) { 75 if (nodeImpacts != null && nodeImpacts.Count > 0) 76 PaintNodeImpacts(); 77 } 78 72 79 private void UpdateView() { 73 80 if (Content == null || Content.Model == null || Content.ProblemData == null) return; … … 75 82 treeChart.Tree = tree.Root.SubtreeCount > 1 ? new SymbolicExpressionTree(tree.Root) : new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0)); 76 83 77 var replacementValues = CalculateReplacementValues(tree); 84 var impactAndReplacementValues = CalculateImpactAndReplacementValues(tree); 85 nodeImpacts = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item1); 86 var replacementValues = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item2); 78 87 foreach (var pair in replacementValues.Where(pair => !(pair.Key is ConstantTreeNode))) { 79 88 foldedNodes[pair.Key] = MakeConstantTreeNode(pair.Value); 80 89 } 81 82 nodeImpacts = CalculateImpactValues(tree);83 90 PaintNodeImpacts(); 84 91 } … … 86 93 protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree); 87 94 protected abstract Dictionary<ISymbolicExpressionTreeNode, double> CalculateImpactValues(ISymbolicExpressionTree tree); 95 protected abstract Dictionary<ISymbolicExpressionTreeNode, Tuple<double, double>> CalculateImpactAndReplacementValues(ISymbolicExpressionTree tree); 88 96 protected abstract void UpdateModel(ISymbolicExpressionTree tree); 89 97 … … 96 104 97 105 private void treeChart_SymbolicExpressionTreeNodeDoubleClicked(object sender, MouseEventArgs e) { 98 var visualNode = (Visual SymbolicExpressionTreeNode)sender;99 var symbExprTreeNode = (SymbolicExpressionTreeNode)visualNode. SymbolicExpressionTreeNode;106 var visualNode = (VisualTreeNode<ISymbolicExpressionTreeNode>)sender; 107 var symbExprTreeNode = (SymbolicExpressionTreeNode)visualNode.Content; 100 108 if (symbExprTreeNode == null) return; 101 109 var tree = Content.Model.SymbolicExpressionTree; … … 125 133 double max = impacts.Max(); 126 134 double min = impacts.Min(); 127 foreach ( ISymbolicExpressionTreeNodetreeNode in Content.Model.SymbolicExpressionTree.IterateNodesPostfix()) {128 Visual SymbolicExpressionTreeNodevisualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode);135 foreach (var treeNode in Content.Model.SymbolicExpressionTree.IterateNodesPostfix()) { 136 VisualTreeNode<ISymbolicExpressionTreeNode> visualTree = treeChart.GetVisualSymbolicExpressionTreeNode(treeNode); 129 137 130 138 if (!(treeNode is ConstantTreeNode) && nodeImpacts.ContainsKey(treeNode)) {
Note: See TracChangeset
for help on using the changeset viewer.