Changeset 10888 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking
- Timestamp:
- 05/26/14 01:56:35 (11 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/FragmentGraphView.cs
r10884 r10888 33 33 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { 34 34 [View("FragmentGraphView")] 35 [Content(typeof( IGenealogyGraph<IFragment<ISymbolicExpressionTreeNode>>), IsDefaultView = true)]35 [Content(typeof(FragmentGraph), IsDefaultView = true)] 36 36 public sealed partial class FragmentGraphView : ItemView { 37 37 private const int PreferredHorizontalSpacing = 10; … … 41 41 private ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> symbolicExpressionEngine; 42 42 43 private Dictionary< IGenealogyGraphNode<IFragment<ISymbolicExpressionTreeNode>>, TileLayoutNode> tileDictionary;43 private Dictionary<FragmentNode, TileLayoutNode> tileDictionary; 44 44 45 45 private SymbolicExpressionTreeTile Root { get; set; } 46 46 47 public new IGenealogyGraph<IFragment<ISymbolicExpressionTreeNode>>Content {48 get { return ( IGenealogyGraph<IFragment<ISymbolicExpressionTreeNode>>)base.Content; }47 public new FragmentGraph Content { 48 get { return (FragmentGraph)base.Content; } 49 49 set { base.Content = value; } 50 50 } … … 63 63 NodeHeight = 40 64 64 }; 65 tileDictionary = new Dictionary< IGenealogyGraphNode<IFragment<ISymbolicExpressionTreeNode>>, TileLayoutNode>();65 tileDictionary = new Dictionary<FragmentNode, TileLayoutNode>(); 66 66 } 67 67 … … 70 70 tileDictionary.Clear(); 71 71 foreach (var node in Content.Nodes) { 72 var graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)node.Content; 72 73 var tile = new SymbolicExpressionTreeTile(chart); 73 74 tile.LayoutEngine = symbolicExpressionEngine; 74 tile.Label = "Generation " + node. Rank + Environment.NewLine +75 "Quality " + String.Format("{0:0.000}", node. Quality);76 tile.Root = node.Content.Root;75 tile.Label = "Generation " + node.Content.Rank + Environment.NewLine + 76 "Quality " + String.Format("{0:0.000}", node.Content.Quality); 77 tile.Root = graphNode.Content.Root; 77 78 var tileNode = new TileLayoutNode { Tile = tile }; 78 79 tileDictionary.Add(node, tileNode); 79 80 } 80 foreach (var node in Content.Nodes.Where(n => n. Children.Any())) {81 foreach (var node in Content.Nodes.Where(n => n.OutArcs.Any())) { 81 82 var layoutNode = tileDictionary[node]; 82 layoutNode.Children = new List<TileLayoutNode>(node. Children.Select(x => tileDictionary[x]));83 layoutNode.Children = new List<TileLayoutNode>(node.OutArcs.Select(a => tileDictionary[(FragmentNode)a.Target])); 83 84 } 84 85 } … … 116 117 var aSize = aTile.Size; 117 118 var aPos = aTile.Position; 118 119 var fragment = node.Content; 120 if ( fragment.Index1> 0) {121 var subtree = fragment.Root.NodeAt(fragment.Index1);119 var graphNode = node.Content; 120 121 if (node.SubtreeIndex > 0) { 122 var subtree = graphNode.Content.Root.NodeAt(node.SubtreeIndex); 122 123 foreach (var s in subtree.IterateNodesPrefix()) { 123 124 var primitive = aTile.GetPrimitive(s); … … 130 131 } 131 132 } 132 if ( fragment.Index2> 0) {133 var subtree = fragment.Root.NodeAt(fragment.Index2);133 if (node.FragmentIndex > 0) { 134 var subtree = graphNode.Content.Root.NodeAt(node.FragmentIndex); 134 135 foreach (var s in subtree.IterateNodesPrefix()) { 135 136 var primitive = aTile.GetPrimitive(s); … … 143 144 } 144 145 145 if (node.Parents.Any() && node == node.Parents.First().Children.First()) { 146 var parent = node.Parents.First(); 147 var index = fragment.Index1 + (parent.Content.Index2 - parent.Content.Index1); 148 // some mutations create discontinuities which invalidate the index 149 if (index >= 0 && index < fragment.Root.GetLength()) { 150 var subtree = fragment.Root.NodeAt(index); 151 var primitive = aTile.GetPrimitive(subtree); 152 primitive.Brush = new SolidBrush(Color.LightCoral); 146 if (node.InArcs.Any()) { 147 var parent = (FragmentNode)node.InArcs.First().Source; 148 if (parent.OutArcs.First().Target == node) { 149 var index = node.SubtreeIndex + (parent.FragmentIndex - parent.SubtreeIndex); 150 // some mutations create discontinuities which invalidate the index 151 if (index >= 0 && index < graphNode.Content.Length) { 152 var subtree = graphNode.Content.NodeAt(index); 153 var primitive = aTile.GetPrimitive(subtree); 154 primitive.Brush = new SolidBrush(Color.LightCoral); 155 } 153 156 } 154 157 } 155 158 156 foreach (var child in node. Children) {159 foreach (var child in node.OutArcs.Select(x => (FragmentNode)x.Target)) { 157 160 var bTile = tileDictionary[child].Tile; 158 161 var bSize = bTile.Size; -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymboldDataAnalysisGenealogyView.Designer.cs
r10833 r10888 51 51 this.genealogyGraphChart = new HeuristicLab.Problems.DataAnalysis.Symbolic.Views.SymbolicDataAnalysisExpressionGenealogyGraphChart(); 52 52 this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart(); 53 this.groupBox1 = new System.Windows.Forms.GroupBox(); 54 this.simpleLineages_checkBox = new System.Windows.Forms.CheckBox(); 55 this.lockGraph_checkBox = new System.Windows.Forms.CheckBox(); 53 56 this.trace_checkBox = new System.Windows.Forms.CheckBox(); 54 this.lockGraph_checkBox = new System.Windows.Forms.CheckBox(); 55 this.simpleLineages_checkBox = new System.Windows.Forms.CheckBox(); 57 this.hotPaths_button = new System.Windows.Forms.Button(); 56 58 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); 57 59 this.splitContainer1.Panel1.SuspendLayout(); 58 60 this.splitContainer1.Panel2.SuspendLayout(); 59 61 this.splitContainer1.SuspendLayout(); 62 this.groupBox1.SuspendLayout(); 60 63 this.SuspendLayout(); 61 64 // 62 65 // splitContainer1 63 66 // 64 this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Bottom; 65 this.splitContainer1.Location = new System.Drawing.Point(0, 33); 67 this.splitContainer1.Location = new System.Drawing.Point(0, 57); 66 68 this.splitContainer1.Name = "splitContainer1"; 67 69 // … … 73 75 // 74 76 this.splitContainer1.Panel2.Controls.Add(this.symbolicExpressionTreeChart); 75 this.splitContainer1.Size = new System.Drawing.Size(1247, 722);77 this.splitContainer1.Size = new System.Drawing.Size(1247, 698); 76 78 this.splitContainer1.SplitterDistance = 607; 77 79 this.splitContainer1.TabIndex = 0; … … 87 89 this.genealogyGraphChart.ScaleOnResize = true; 88 90 this.genealogyGraphChart.SimpleLineages = false; 89 this.genealogyGraphChart.Size = new System.Drawing.Size(607, 722);91 this.genealogyGraphChart.Size = new System.Drawing.Size(607, 698); 90 92 this.genealogyGraphChart.TabIndex = 0; 91 93 this.genealogyGraphChart.TraceFragments = false; … … 98 100 this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(0, 0); 99 101 this.symbolicExpressionTreeChart.Name = "symbolicExpressionTreeChart"; 100 this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(636, 722);102 this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(636, 698); 101 103 this.symbolicExpressionTreeChart.Spacing = 5; 102 104 this.symbolicExpressionTreeChart.SuspendRepaint = false; 103 105 this.symbolicExpressionTreeChart.TabIndex = 0; 104 this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font( FontFamily.GenericSansSerif, 10);106 this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Microsoft Sans Serif", 10F); 105 107 this.symbolicExpressionTreeChart.Tree = null; 108 // 109 // groupBox1 110 // 111 this.groupBox1.Controls.Add(this.hotPaths_button); 112 this.groupBox1.Controls.Add(this.simpleLineages_checkBox); 113 this.groupBox1.Controls.Add(this.lockGraph_checkBox); 114 this.groupBox1.Controls.Add(this.trace_checkBox); 115 this.groupBox1.Location = new System.Drawing.Point(3, 3); 116 this.groupBox1.Name = "groupBox1"; 117 this.groupBox1.Size = new System.Drawing.Size(1195, 48); 118 this.groupBox1.TabIndex = 4; 119 this.groupBox1.TabStop = false; 120 this.groupBox1.Text = "Controls"; 121 // 122 // simpleLineages_checkBox 123 // 124 this.simpleLineages_checkBox.AutoSize = true; 125 this.simpleLineages_checkBox.Location = new System.Drawing.Point(94, 19); 126 this.simpleLineages_checkBox.Name = "simpleLineages_checkBox"; 127 this.simpleLineages_checkBox.Size = new System.Drawing.Size(103, 17); 128 this.simpleLineages_checkBox.TabIndex = 6; 129 this.simpleLineages_checkBox.Text = "Simple Lineages"; 130 this.simpleLineages_checkBox.UseVisualStyleBackColor = true; 131 this.simpleLineages_checkBox.CheckedChanged += new System.EventHandler(this.simpleLineages_checkBox_CheckedChanged); 132 // 133 // lockGraph_checkBox 134 // 135 this.lockGraph_checkBox.AutoSize = true; 136 this.lockGraph_checkBox.Location = new System.Drawing.Point(6, 19); 137 this.lockGraph_checkBox.Name = "lockGraph_checkBox"; 138 this.lockGraph_checkBox.Size = new System.Drawing.Size(82, 17); 139 this.lockGraph_checkBox.TabIndex = 5; 140 this.lockGraph_checkBox.Text = "Lock Graph"; 141 this.lockGraph_checkBox.UseVisualStyleBackColor = true; 142 this.lockGraph_checkBox.CheckedChanged += new System.EventHandler(this.lockGraph_checkBox_CheckedChanged); 106 143 // 107 144 // trace_checkBox 108 145 // 109 146 this.trace_checkBox.AutoSize = true; 110 this.trace_checkBox.Location = new System.Drawing.Point( 611, 10);147 this.trace_checkBox.Location = new System.Drawing.Point(203, 19); 111 148 this.trace_checkBox.Name = "trace_checkBox"; 112 149 this.trace_checkBox.Size = new System.Drawing.Size(54, 17); 113 this.trace_checkBox.TabIndex = 1;150 this.trace_checkBox.TabIndex = 4; 114 151 this.trace_checkBox.Text = "Trace"; 115 152 this.trace_checkBox.UseVisualStyleBackColor = true; 116 153 this.trace_checkBox.CheckedChanged += new System.EventHandler(this.trace_checkBox_CheckedChanged); 117 154 // 118 // lockGraph_checkBox155 // hotPaths_button 119 156 // 120 this.lockGraph_checkBox.AutoSize = true; 121 this.lockGraph_checkBox.Location = new System.Drawing.Point(4, 10); 122 this.lockGraph_checkBox.Name = "lockGraph_checkBox"; 123 this.lockGraph_checkBox.Size = new System.Drawing.Size(82, 17); 124 this.lockGraph_checkBox.TabIndex = 2; 125 this.lockGraph_checkBox.Text = "Lock Graph"; 126 this.lockGraph_checkBox.UseVisualStyleBackColor = true; 127 this.lockGraph_checkBox.CheckedChanged += new System.EventHandler(this.lockGraph_checkBox_CheckedChanged); 128 // 129 // simpleLineages_checkBox 130 // 131 this.simpleLineages_checkBox.AutoSize = true; 132 this.simpleLineages_checkBox.Location = new System.Drawing.Point(91, 10); 133 this.simpleLineages_checkBox.Name = "simpleLineages_checkBox"; 134 this.simpleLineages_checkBox.Size = new System.Drawing.Size(103, 17); 135 this.simpleLineages_checkBox.TabIndex = 3; 136 this.simpleLineages_checkBox.Text = "Simple Lineages"; 137 this.simpleLineages_checkBox.UseVisualStyleBackColor = true; 138 this.simpleLineages_checkBox.CheckedChanged += new System.EventHandler(this.simpleLineages_checkBox_CheckedChanged); 157 this.hotPaths_button.Location = new System.Drawing.Point(263, 15); 158 this.hotPaths_button.Name = "hotPaths_button"; 159 this.hotPaths_button.Size = new System.Drawing.Size(75, 23); 160 this.hotPaths_button.TabIndex = 7; 161 this.hotPaths_button.Text = "Hot paths"; 162 this.hotPaths_button.UseVisualStyleBackColor = true; 163 this.hotPaths_button.Click += new System.EventHandler(this.hotPaths_button_Click); 139 164 // 140 165 // SymboldDataAnalysisGenealogyView … … 142 167 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 143 168 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 144 this.Controls.Add(this.simpleLineages_checkBox); 145 this.Controls.Add(this.lockGraph_checkBox); 146 this.Controls.Add(this.trace_checkBox); 169 this.Controls.Add(this.groupBox1); 147 170 this.Controls.Add(this.splitContainer1); 148 171 this.Name = "SymboldDataAnalysisGenealogyView"; … … 152 175 ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); 153 176 this.splitContainer1.ResumeLayout(false); 177 this.groupBox1.ResumeLayout(false); 178 this.groupBox1.PerformLayout(); 154 179 this.ResumeLayout(false); 155 this.PerformLayout();156 180 157 181 } … … 162 186 private SymbolicDataAnalysisExpressionGenealogyGraphChart genealogyGraphChart; 163 187 private Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart symbolicExpressionTreeChart; 188 private System.Windows.Forms.GroupBox groupBox1; 189 private System.Windows.Forms.CheckBox simpleLineages_checkBox; 190 private System.Windows.Forms.CheckBox lockGraph_checkBox; 164 191 private System.Windows.Forms.CheckBox trace_checkBox; 165 private System.Windows.Forms.CheckBox lockGraph_checkBox; 166 private System.Windows.Forms.CheckBox simpleLineages_checkBox; 192 private System.Windows.Forms.Button hotPaths_button; 167 193 168 194 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/Tracking/SymboldDataAnalysisGenealogyView.cs
r10755 r10888 30 30 using HeuristicLab.EvolutionTracking.Views; 31 31 using HeuristicLab.MainForm; 32 33 32 34 33 namespace HeuristicLab.Problems.DataAnalysis.Symbolic.Views { … … 161 160 } 162 161 #endregion 162 163 private void hotPaths_button_Click(object sender, System.EventArgs e) { 164 genealogyGraphChart.HighlightHotPaths(); 165 } 163 166 } 164 167 }
Note: See TracChangeset
for help on using the changeset viewer.