Changeset 17825 for branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
- Timestamp:
- 01/27/21 14:10:56 (4 years ago)
- Location:
- branches/3040_VectorBasedGP
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3040_VectorBasedGP
- Property svn:mergeinfo changed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views
- Property svn:mergeinfo changed
-
branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
r17786 r17825 35 35 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { 36 36 public abstract partial class InteractiveSymbolicDataAnalysisSolutionSimplifierView : AsynchronousContentView { 37 private Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> foldedNodes; 38 private Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> changedNodes; 39 private Dictionary<ISymbolicExpressionTreeNode, double> nodeImpacts; 37 private readonly Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> foldedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>(); 38 private readonly Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode> changedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>(); 39 private readonly Dictionary<ISymbolicExpressionTreeNode, Interval> nodeIntervals = new Dictionary<ISymbolicExpressionTreeNode, Interval>(); 40 private readonly Dictionary<ISymbolicExpressionTreeNode, double> nodeImpacts = new Dictionary<ISymbolicExpressionTreeNode, double>(); 40 41 41 42 private readonly ISymbolicDataAnalysisSolutionImpactValuesCalculator impactCalculator; … … 49 50 protected InteractiveSymbolicDataAnalysisSolutionSimplifierView(ISymbolicDataAnalysisSolutionImpactValuesCalculator impactCalculator) { 50 51 InitializeComponent(); 51 foldedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>();52 changedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>();53 nodeImpacts = new Dictionary<ISymbolicExpressionTreeNode, double>();54 52 this.Caption = "Interactive Solution Simplifier"; 55 53 this.impactCalculator = impactCalculator; … … 181 179 protected override void OnContentChanged() { 182 180 base.OnContentChanged(); 183 foldedNodes = new Dictionary<ISymbolicExpressionTreeNode, ISymbolicExpressionTreeNode>(); 181 foldedNodes.Clear(); 182 changedNodes.Clear(); 183 nodeIntervals.Clear(); 184 nodeImpacts.Clear(); 184 185 UpdateView(); 185 186 viewHost.Content = this.Content; … … 213 214 foldedNodes[pair.Key] = MakeConstantTreeNode(pair.Value); 214 215 } 215 216 nodeImpacts = impactAndReplacementValues.ToDictionary(x => x.Key, x => x.Value.Item1); 216 217 foreach (var pair in impactAndReplacementValues) { 218 nodeImpacts[pair.Key] = pair.Value.Item1; 219 } 220 221 if (IntervalInterpreter.IsCompatible(tree)) { 222 var regressionProblemData = Content.ProblemData as IRegressionProblemData; 223 if (regressionProblemData != null) { 224 var interpreter = new IntervalInterpreter(); 225 var variableRanges = regressionProblemData.VariableRanges.GetReadonlyDictionary(); 226 IDictionary<ISymbolicExpressionTreeNode, Interval> intervals; 227 interpreter.GetSymbolicExpressionTreeIntervals(tree, variableRanges, out intervals); 228 foreach (var kvp in intervals) { 229 nodeIntervals[kvp.Key] = kvp.Value; 230 } 231 } 232 } 217 233 } finally { 218 234 progress.Finish(); … … 320 336 } 321 337 } 322 if (visualTree != null) 338 if (visualTree != null) { 339 if (nodeIntervals.ContainsKey(treeNode)) 340 visualTree.ToolTip += String.Format($"{Environment.NewLine}Intervals: [{nodeIntervals[treeNode].LowerBound:G5} ... {nodeIntervals[treeNode].UpperBound:G5}]"); 323 341 if (changedNodes.ContainsKey(treeNode)) { 324 342 visualTree.LineColor = Color.DodgerBlue; … … 326 344 visualTree.LineColor = Color.DarkOrange; 327 345 } 346 } 328 347 } 329 348 treeChart.RepaintNodes();
Note: See TracChangeset
for help on using the changeset viewer.