Changeset 6113
- Timestamp:
- 05/03/11 18:43:22 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r6108 r6113 34 34 private Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> replacementNodes; 35 35 private Dictionary<ISymbolicExpressionTreeNode, double> nodeImpacts; 36 private bool updateInProgress = false; 36 37 37 38 public InteractiveSymbolicDataAnalysisSolutionSimplifierView() { … … 90 91 nodeImpacts = CalculateImpactValues(Content.Model.SymbolicExpressionTree); 91 92 92 // automatically fold all branches with impact = 1 93 List<ISymbolicExpressionTreeNode> nodeList = Content.Model.SymbolicExpressionTree.Root.GetSubtree(0).IterateNodesPrefix().ToList(); 94 foreach (var parent in nodeList) { 95 for (int subTreeIndex = 0; subTreeIndex < parent.SubtreesCount; subTreeIndex++) { 96 var child = parent.GetSubtree(subTreeIndex); 97 if (!(child.Symbol is Constant) && nodeImpacts[child].IsAlmost(0.0)) { 98 SwitchNodeWithReplacementNode(parent, subTreeIndex); 93 if (!updateInProgress) { 94 // automatically fold all branches with impact = 1 95 List<ISymbolicExpressionTreeNode> nodeList = Content.Model.SymbolicExpressionTree.Root.GetSubtree(0).IterateNodesPrefix().ToList(); 96 foreach (var parent in nodeList) { 97 for (int subTreeIndex = 0; subTreeIndex < parent.SubtreesCount; subTreeIndex++) { 98 var child = parent.GetSubtree(subTreeIndex); 99 if (!(child.Symbol is Constant) && nodeImpacts[child].IsAlmost(0.0)) { 100 SwitchNodeWithReplacementNode(parent, subTreeIndex); 101 } 99 102 } 100 103 } 101 104 } 105 102 106 // show only interesting part of solution 103 107 if (tree.Root.SubtreesCount > 1) … … 138 142 this.treeChart.Tree = new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0)); // 1st child of RPB 139 143 144 updateInProgress = true; 140 145 UpdateModel(tree); 146 updateInProgress = false; 141 147 return; // break all loops 142 148 }
Note: See TracChangeset
for help on using the changeset viewer.