Changeset 9420 for branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views
- Timestamp:
- 05/02/13 13:21:35 (12 years ago)
- Location:
- branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4
- Files:
-
- 3 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.Designer.cs
r8213 r9420 45 45 /// </summary> 46 46 private void InitializeComponent() { 47 this.components = new System.ComponentModel.Container(); 48 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 47 ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); 49 48 this.SuspendLayout(); 49 // 50 // pictureBox 51 // 52 this.pictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); 53 this.pictureBox.Dock = System.Windows.Forms.DockStyle.Fill; 50 54 // 51 55 // GenealogyGraphChart … … 54 58 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 55 59 this.Name = "GenealogyGraphChart"; 60 this.Controls.SetChildIndex(this.pictureBox, 0); 61 ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); 56 62 this.ResumeLayout(false); 57 63 -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphChart.cs
r9239 r9420 28 28 using HeuristicLab.Common; 29 29 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 30 using HeuristicLab.Problems.DataAnalysis.Symbolic;31 30 using HeuristicLab.Visualization; 32 31 … … 42 41 private Visualization.Rectangle targetRectangle; // provides a rectangle mark of the currently selected genealogy graph node 43 42 43 public bool SimpleLineages { get; set; } 44 public bool LockGenealogy { get; set; } 45 46 private bool drawing; 47 44 48 private SymbolicExpressionTreeGenealogyGraph graph; 45 49 public SymbolicExpressionTreeGenealogyGraph Graph { … … 48 52 graph = value; 49 53 if (graph == null) return; 50 // TODO: should move the subtree sorting code out of here and int the view51 var canonicalSorter = new SymbolicExpressionTreeCanonicalSorter();52 // sort subtrees in order to improve matching53 foreach (var tree in graph.Nodes.Select(n => n.SymbolicExpressionTree))54 canonicalSorter.SortSubtrees(tree);55 54 56 55 visualNodeMap = new Dictionary<string, VisualGenealogyGraphNode>(); … … 68 67 } 69 68 69 private VisualGenealogyGraphArc GetVisualGenealogyGraphArc(IVertex source, IVertex target) { 70 VisualGenealogyGraphNode visualSource; 71 VisualGenealogyGraphNode visualTarget; 72 visualNodeMap.TryGetValue(source.Id, out visualSource); 73 visualNodeMap.TryGetValue(target.Id, out visualTarget); 74 if (visualSource != null && visualTarget != null) { 75 VisualGenealogyGraphArc visualArc; 76 visualArcMap.TryGetValue( 77 new Tuple<VisualGenealogyGraphNode, VisualGenealogyGraphNode>(visualSource, visualTarget), out visualArc); 78 if (visualArc != null) return visualArc; 79 } 80 return null; 81 } 82 70 83 public event MouseEventHandler GenealogyGraphNodeClicked; 71 84 private void OnGenealogyGraphNodeClicked(object sender, MouseEventArgs e) { … … 84 97 Chart.UpdateEnabled = false; 85 98 99 drawing = true; 100 86 101 var layers = Graph.Nodes.GroupBy(n => n.Rank).OrderBy(g => g.Key).Select(g => new { Rank = g.Key, Nodes = g.ToList() }).ToList(); 87 102 103 y = PreferredSize.Height + Cx + 2 * Diameter; 104 88 105 for (int i = 0; i != layers.Count; ++i) { 106 x = 0; 107 layers[i].Nodes.Sort((b, a) => Graph.Compare(a, b)); 108 double rank = Math.Floor(layers[i].Rank); 109 if (layers[i].Rank.IsAlmost(rank)) { 110 var visualTextNode = new VisualGenealogyGraphTextLabel(Chart, x, y + 2, x + Diameter, y + Diameter) { 111 Brush = new SolidBrush(Color.Black), 112 Font = new Font("Arial", Diameter - 4, FontStyle.Regular, GraphicsUnit.Pixel), 113 Text = String.Format("{0:0}", rank) 114 }; 115 Chart.Group.Add(visualTextNode); 116 } 117 89 118 // sort descending by quality (using comparison defined in GenealogyGraphNode class) 90 layers[i].Nodes.Sort((b, a) => Graph.Compare(a, b));91 x = 0; // reset horizontal coordinate 119 x += (int)Math.Floor(1.5 * Cx); // reset horizontal coordinate 120 92 121 foreach (var node in layers[i].Nodes) { 93 122 var pen = new Pen(Color.LightGray); … … 95 124 var visualNode = new VisualGenealogyGraphNode(Chart, x, y, x + Diameter, y + Diameter, pen, null) { 96 125 Data = node, 97 ToolTipText = "Id: " + node.Label + nl + 98 "Rank: " + node.Rank + nl + 126 ToolTipText = "Rank: " + node.Rank + nl + 99 127 "Quality: " + String.Format("{0:0.0000}", node.Quality) + nl + 100 128 "IsElite: " + node.IsElite … … 135 163 } 136 164 137 Chart.UpdateEnabled = true; 138 Chart.EnforceUpdate(); 165 // highlight the most recent common ancestor ("eve" individual) 166 // var eve = graph.MostRecentCommonAncestor(); 167 // if (eve != null) { 168 // var visualGraphNode = GetVisualGenealogyGraphNode(eve); 169 170 // var brush = new SolidBrush(Color.BlueViolet); 171 // visualGraphNode.Brush = brush; 172 // } 173 174 Chart.UpdateEnabled = true; 175 Chart.EnforceUpdate(); 176 177 drawing = false; 139 178 } 140 179 … … 150 189 } 151 190 191 protected override void pictureBox_MouseMove(object sender, MouseEventArgs e) { 192 if (!drawing) 193 base.pictureBox_MouseMove(sender, e); 194 } 195 152 196 protected override void pictureBox_MouseUp(object sender, MouseEventArgs e) { 153 197 if (Chart.Mode != ChartMode.Select) { … … 163 207 selectedGenealogyGraphNode = visualNodes[0] as VisualGenealogyGraphNode; 164 208 if (selectedGenealogyGraphNode == null) return; 165 // new node has been selected, clean up 166 Chart.UpdateEnabled = false; 167 // clear colors 168 ClearAllNodes(); 169 // use a rectangle to highlight the currently selected genealogy graph node 209 210 if (!LockGenealogy) { 211 // new node has been selected, clean up 212 Chart.UpdateEnabled = false; 213 if (ModifierKeys != Keys.Shift) 214 // clear colors 215 ClearAllNodes(); 216 // use a rectangle to highlight the currently selected genealogy graph node 217 var gNode = selectedGenealogyGraphNode.Data; 218 var visualNode = GetVisualGenealogyGraphNode(gNode); 219 220 DrawLineage(visualNode, n => SimpleLineages ? n.IncomingArcs.Take(1) : n.IncomingArcs, a => a.Source); 221 visualNode.Brush = null; 222 DrawLineage(visualNode, n => n.OutgoingArcs, a => a.Target); 223 } 224 170 225 MarkSelectedNode(); 171 var gNode = selectedGenealogyGraphNode.Data;172 var visualNode = GetVisualGenealogyGraphNode(gNode);173 174 DrawLineage(visualNode, n => n.IncomingArcs, a => a.Source);175 visualNode.Brush = null;176 DrawLineage(visualNode, n => n.OutgoingArcs, a => a.Target);177 226 178 227 // update … … 185 234 } 186 235 187 private void DrawLineage(VisualGenealogyGraphNode node, 188 Func<VisualGenealogyGraphNode, IEnumerable<VisualGenealogyGraphArc>> arcSelector, 189 Func<VisualGenealogyGraphArc, VisualGenealogyGraphNode> nodeSelector) { 236 private void DrawLineage(VisualGenealogyGraphNode node, Func<VisualGenealogyGraphNode, IEnumerable<VisualGenealogyGraphArc>> arcSelector, Func<VisualGenealogyGraphArc, VisualGenealogyGraphNode> nodeSelector) { 190 237 if (node.Brush != null) return; 191 238 node.Brush = new SolidBrush(node.Data.GetColor()); 192 239 var arcs = arcSelector(node); 193 240 if (arcs == null) return; 241 194 242 foreach (var arc in arcs) { 195 243 var source = arc.Source.Data; … … 198 246 var end = new Point((int)arc.End.X, (int)arc.End.Y); 199 247 arc.Pen.Brush = new LinearGradientBrush(start, end, source.GetColor(), target.GetColor()); 248 arc.Pen.Color = Color.Transparent; 249 // arc.Pen.Brush = new SolidBrush(Color.DarkGray); 200 250 DrawLineage(nodeSelector(arc), arcSelector, nodeSelector); 201 251 } … … 231 281 232 282 // TODO: optimize and reduce complexity of this method 233 public void HighlightNodes(IEnumerable<ISymbolicExpressionTree> trees , Color color) {283 public void HighlightNodes(IEnumerable<ISymbolicExpressionTree> trees) { 234 284 foreach (var tree in trees) { 235 285 var graphNodes = graph.GetGraphNodes(tree); 236 286 foreach (var graphNode in graphNodes) { 237 GetVisualGenealogyGraphNode(graphNode).Brush = new SolidBrush(color); 287 GetVisualGenealogyGraphNode(graphNode).Brush = new SolidBrush(graphNode.GetColor()); 288 } 289 } 290 } 291 292 public void HighlightArcs(IEnumerable<IEdge> arcs, Color color) { 293 foreach (var a in arcs) { 294 var arc = GetVisualGenealogyGraphArc(a.Source, a.Target); 295 if (arc != null) { 296 var source = arc.Source.Data; 297 var target = arc.Target.Data; 298 var start = new Point((int)arc.Start.X, (int)arc.Start.Y); 299 var end = new Point((int)arc.End.X, (int)arc.End.Y); 300 arc.Pen.Brush = new LinearGradientBrush(start, end, source.GetColor(), target.GetColor()); 238 301 } 239 302 } … … 242 305 public void HighlightNode(SymbolicExpressionGenealogyGraphNode graphNode, Color color) { 243 306 GetVisualGenealogyGraphNode(graphNode).Brush = new SolidBrush(color); 307 } 308 309 public void HighlightAll() { 310 Chart.UpdateEnabled = false; 311 foreach (var visualNode in visualNodeMap.Values) { 312 visualNode.Brush = new SolidBrush(visualNode.Data.GetColor()); 313 } 314 foreach (var arc in visualArcMap.Values) { 315 var source = arc.Source.Data; 316 var target = arc.Target.Data; 317 var start = new Point((int)arc.Start.X, (int)arc.Start.Y); 318 var end = new Point((int)arc.End.X, (int)arc.End.Y); 319 arc.Pen.Brush = new LinearGradientBrush(start, end, source.GetColor(), target.GetColor()); 320 } 321 Chart.UpdateEnabled = true; 322 Chart.EnforceUpdate(); 244 323 } 245 324 -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.Designer.cs
r9084 r9420 1 1 2 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views; 3 2 4 namespace HeuristicLab.EvolutionaryTracking.Views { 3 5 partial class GenealogyGraphView { … … 26 28 private void InitializeComponent() { 27 29 this.components = new System.ComponentModel.Container(); 28 this.mainTableLayout = new System.Windows.Forms.TableLayoutPanel();29 30 this.splitContainer = new System.Windows.Forms.SplitContainer(); 30 this.genealogyTableLayout = new System.Windows.Forms.TableLayoutPanel();31 31 this.genealogyGraphChart = new HeuristicLab.EvolutionaryTracking.Views.GenealogyGraphChart(); 32 32 this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart(); 33 this.topControlBox = new System.Windows.Forms.GroupBox(); 33 this.topControlBox = new System.Windows.Forms.Panel(); 34 this.groupBox1 = new System.Windows.Forms.GroupBox(); 35 this.matchConstantsCheckBox = new System.Windows.Forms.CheckBox(); 36 this.matchVariableWeightsCheckBox = new System.Windows.Forms.CheckBox(); 34 37 this.matchVariableNamesCheckBox = new System.Windows.Forms.CheckBox(); 35 this. matchVariableWeightsCheckBox = new System.Windows.Forms.CheckBox();36 this. matchConstantsCheckBox = new System.Windows.Forms.CheckBox();37 this. similarityLabel = new System.Windows.Forms.Label();38 this. graphControlsPanel = new System.Windows.Forms.Panel();38 this.graphControlsGroupBox = new System.Windows.Forms.GroupBox(); 39 this.lockGenealogyCheckBox = new System.Windows.Forms.CheckBox(); 40 this.highlightAllButton = new System.Windows.Forms.Button(); 41 this.simpleLineagesCheckBox = new System.Windows.Forms.CheckBox(); 39 42 this.selectModeButton = new System.Windows.Forms.RadioButton(); 40 43 this.moveModeButton = new System.Windows.Forms.RadioButton(); 41 44 this.zoomModeButton = new System.Windows.Forms.RadioButton(); 42 this. mainTableLayout.SuspendLayout();45 this.toolTip = new System.Windows.Forms.ToolTip(this.components); 43 46 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); 44 47 this.splitContainer.Panel1.SuspendLayout(); 45 48 this.splitContainer.Panel2.SuspendLayout(); 46 49 this.splitContainer.SuspendLayout(); 47 this.genealogyTableLayout.SuspendLayout();48 50 this.topControlBox.SuspendLayout(); 49 this.graphControlsPanel.SuspendLayout(); 51 this.groupBox1.SuspendLayout(); 52 this.graphControlsGroupBox.SuspendLayout(); 50 53 this.SuspendLayout(); 51 54 // 52 // mainTableLayout53 //54 this.mainTableLayout.ColumnCount = 1;55 this.mainTableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));56 this.mainTableLayout.Controls.Add(this.splitContainer, 0, 1);57 this.mainTableLayout.Controls.Add(this.topControlBox, 0, 0);58 this.mainTableLayout.Dock = System.Windows.Forms.DockStyle.Fill;59 this.mainTableLayout.Location = new System.Drawing.Point(0, 0);60 this.mainTableLayout.Name = "mainTableLayout";61 this.mainTableLayout.RowCount = 2;62 this.mainTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle());63 this.mainTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));64 this.mainTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F));65 this.mainTableLayout.Size = new System.Drawing.Size(787, 584);66 this.mainTableLayout.TabIndex = 6;67 //68 55 // splitContainer 69 56 // 57 this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 58 | System.Windows.Forms.AnchorStyles.Left) 59 | System.Windows.Forms.AnchorStyles.Right))); 70 60 this.splitContainer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 71 this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;72 61 this.splitContainer.Location = new System.Drawing.Point(3, 53); 73 62 this.splitContainer.Name = "splitContainer"; … … 75 64 // splitContainer.Panel1 76 65 // 77 this.splitContainer.Panel1.Controls.Add(this.genealogy TableLayout);66 this.splitContainer.Panel1.Controls.Add(this.genealogyGraphChart); 78 67 this.splitContainer.Panel1MinSize = 50; 79 68 // … … 82 71 this.splitContainer.Panel2.Controls.Add(this.symbolicExpressionTreeChart); 83 72 this.splitContainer.Panel2MinSize = 50; 84 this.splitContainer.Size = new System.Drawing.Size( 781, 528);85 this.splitContainer.SplitterDistance = 360;73 this.splitContainer.Size = new System.Drawing.Size(1066, 722); 74 this.splitContainer.SplitterDistance = 489; 86 75 this.splitContainer.TabIndex = 7; 87 //88 // genealogyTableLayout89 //90 this.genealogyTableLayout.ColumnCount = 1;91 this.genealogyTableLayout.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));92 this.genealogyTableLayout.Controls.Add(this.genealogyGraphChart, 0, 1);93 this.genealogyTableLayout.Dock = System.Windows.Forms.DockStyle.Fill;94 this.genealogyTableLayout.Location = new System.Drawing.Point(0, 0);95 this.genealogyTableLayout.Name = "genealogyTableLayout";96 this.genealogyTableLayout.RowCount = 2;97 this.genealogyTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle());98 this.genealogyTableLayout.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));99 this.genealogyTableLayout.Size = new System.Drawing.Size(358, 526);100 this.genealogyTableLayout.TabIndex = 4;101 76 // 102 77 // genealogyGraphChart … … 104 79 this.genealogyGraphChart.BackColor = System.Drawing.SystemColors.Control; 105 80 this.genealogyGraphChart.Dock = System.Windows.Forms.DockStyle.Fill; 106 this.genealogyGraphChart.Location = new System.Drawing.Point(3, 3); 81 this.genealogyGraphChart.Location = new System.Drawing.Point(0, 0); 82 this.genealogyGraphChart.LockGenealogy = false; 107 83 this.genealogyGraphChart.Name = "genealogyGraphChart"; 108 84 this.genealogyGraphChart.ScaleOnResize = true; 109 this.genealogyGraphChart.Size = new System.Drawing.Size(352, 520); 85 this.genealogyGraphChart.SimpleLineages = false; 86 this.genealogyGraphChart.Size = new System.Drawing.Size(487, 720); 110 87 this.genealogyGraphChart.TabIndex = 2; 111 88 // … … 117 94 this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(0, 0); 118 95 this.symbolicExpressionTreeChart.Name = "symbolicExpressionTreeChart"; 119 this.symbolicExpressionTreeChart.Size = new System.Drawing.Size( 415, 526);96 this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(571, 720); 120 97 this.symbolicExpressionTreeChart.Spacing = 5; 121 98 this.symbolicExpressionTreeChart.SuspendRepaint = false; … … 126 103 // topControlBox 127 104 // 128 this.topControlBox.Controls.Add(this.matchVariableNamesCheckBox); 129 this.topControlBox.Controls.Add(this.matchVariableWeightsCheckBox); 130 this.topControlBox.Controls.Add(this.matchConstantsCheckBox); 131 this.topControlBox.Controls.Add(this.similarityLabel); 132 this.topControlBox.Controls.Add(this.graphControlsPanel); 133 this.topControlBox.Dock = System.Windows.Forms.DockStyle.Fill; 105 this.topControlBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) 106 | System.Windows.Forms.AnchorStyles.Right))); 107 this.topControlBox.Controls.Add(this.groupBox1); 108 this.topControlBox.Controls.Add(this.graphControlsGroupBox); 134 109 this.topControlBox.Location = new System.Drawing.Point(3, 3); 135 110 this.topControlBox.Name = "topControlBox"; 136 this.topControlBox.Size = new System.Drawing.Size( 781, 44);111 this.topControlBox.Size = new System.Drawing.Size(1066, 44); 137 112 this.topControlBox.TabIndex = 6; 138 this.topControlBox.TabStop = false; 139 this.topControlBox.Text = "Controls"; 113 // 114 // groupBox1 115 // 116 this.groupBox1.Controls.Add(this.matchConstantsCheckBox); 117 this.groupBox1.Controls.Add(this.matchVariableWeightsCheckBox); 118 this.groupBox1.Controls.Add(this.matchVariableNamesCheckBox); 119 this.groupBox1.Location = new System.Drawing.Point(209, -2); 120 this.groupBox1.Name = "groupBox1"; 121 this.groupBox1.Size = new System.Drawing.Size(325, 44); 122 this.groupBox1.TabIndex = 12; 123 this.groupBox1.TabStop = false; 124 this.groupBox1.Text = "Matching constraints"; 125 // 126 // matchConstantsCheckBox 127 // 128 this.matchConstantsCheckBox.AutoSize = true; 129 this.matchConstantsCheckBox.Checked = true; 130 this.matchConstantsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 131 this.matchConstantsCheckBox.Location = new System.Drawing.Point(6, 19); 132 this.matchConstantsCheckBox.Name = "matchConstantsCheckBox"; 133 this.matchConstantsCheckBox.Size = new System.Drawing.Size(102, 17); 134 this.matchConstantsCheckBox.TabIndex = 5; 135 this.matchConstantsCheckBox.Text = "Constant values"; 136 this.matchConstantsCheckBox.UseVisualStyleBackColor = true; 137 this.matchConstantsCheckBox.CheckedChanged += new System.EventHandler(this.matchConstantsCheckBox_CheckedChanged); 138 // 139 // matchVariableWeightsCheckBox 140 // 141 this.matchVariableWeightsCheckBox.AutoSize = true; 142 this.matchVariableWeightsCheckBox.Checked = true; 143 this.matchVariableWeightsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 144 this.matchVariableWeightsCheckBox.Location = new System.Drawing.Point(114, 19); 145 this.matchVariableWeightsCheckBox.Name = "matchVariableWeightsCheckBox"; 146 this.matchVariableWeightsCheckBox.Size = new System.Drawing.Size(103, 17); 147 this.matchVariableWeightsCheckBox.TabIndex = 6; 148 this.matchVariableWeightsCheckBox.Text = "Variable weights"; 149 this.matchVariableWeightsCheckBox.UseVisualStyleBackColor = true; 150 this.matchVariableWeightsCheckBox.CheckedChanged += new System.EventHandler(this.matchVariableWeightsCheckBox_CheckedChanged); 140 151 // 141 152 // matchVariableNamesCheckBox … … 144 155 this.matchVariableNamesCheckBox.Checked = true; 145 156 this.matchVariableNamesCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 146 this.matchVariableNamesCheckBox.Location = new System.Drawing.Point( 436, 23);157 this.matchVariableNamesCheckBox.Location = new System.Drawing.Point(223, 19); 147 158 this.matchVariableNamesCheckBox.Name = "matchVariableNamesCheckBox"; 148 159 this.matchVariableNamesCheckBox.Size = new System.Drawing.Size(98, 17); … … 152 163 this.matchVariableNamesCheckBox.CheckedChanged += new System.EventHandler(this.matchVariableNamesCheckBox_CheckedChanged); 153 164 // 154 // matchVariableWeightsCheckBox 155 // 156 this.matchVariableWeightsCheckBox.AutoSize = true; 157 this.matchVariableWeightsCheckBox.Checked = true; 158 this.matchVariableWeightsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 159 this.matchVariableWeightsCheckBox.Location = new System.Drawing.Point(327, 23); 160 this.matchVariableWeightsCheckBox.Name = "matchVariableWeightsCheckBox"; 161 this.matchVariableWeightsCheckBox.Size = new System.Drawing.Size(103, 17); 162 this.matchVariableWeightsCheckBox.TabIndex = 6; 163 this.matchVariableWeightsCheckBox.Text = "Variable weights"; 164 this.matchVariableWeightsCheckBox.UseVisualStyleBackColor = true; 165 this.matchVariableWeightsCheckBox.CheckedChanged += new System.EventHandler(this.matchVariableWeightsCheckBox_CheckedChanged); 166 // 167 // matchConstantsCheckBox 168 // 169 this.matchConstantsCheckBox.AutoSize = true; 170 this.matchConstantsCheckBox.Checked = true; 171 this.matchConstantsCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; 172 this.matchConstantsCheckBox.Location = new System.Drawing.Point(219, 23); 173 this.matchConstantsCheckBox.Name = "matchConstantsCheckBox"; 174 this.matchConstantsCheckBox.Size = new System.Drawing.Size(102, 17); 175 this.matchConstantsCheckBox.TabIndex = 5; 176 this.matchConstantsCheckBox.Text = "Constant values"; 177 this.matchConstantsCheckBox.UseVisualStyleBackColor = true; 178 this.matchConstantsCheckBox.CheckedChanged += new System.EventHandler(this.matchConstantsCheckBox_CheckedChanged); 179 // 180 // similarityLabel 181 // 182 this.similarityLabel.AutoSize = true; 183 this.similarityLabel.Location = new System.Drawing.Point(105, 24); 184 this.similarityLabel.Name = "similarityLabel"; 185 this.similarityLabel.Size = new System.Drawing.Size(108, 13); 186 this.similarityLabel.TabIndex = 3; 187 this.similarityLabel.Text = "Matching constraints:"; 188 // 189 // graphControlsPanel 190 // 191 this.graphControlsPanel.Controls.Add(this.selectModeButton); 192 this.graphControlsPanel.Controls.Add(this.moveModeButton); 193 this.graphControlsPanel.Controls.Add(this.zoomModeButton); 194 this.graphControlsPanel.Location = new System.Drawing.Point(6, 14); 195 this.graphControlsPanel.Name = "graphControlsPanel"; 196 this.graphControlsPanel.Size = new System.Drawing.Size(93, 30); 197 this.graphControlsPanel.TabIndex = 2; 165 // graphControlsGroupBox 166 // 167 this.graphControlsGroupBox.Controls.Add(this.lockGenealogyCheckBox); 168 this.graphControlsGroupBox.Controls.Add(this.highlightAllButton); 169 this.graphControlsGroupBox.Controls.Add(this.simpleLineagesCheckBox); 170 this.graphControlsGroupBox.Controls.Add(this.selectModeButton); 171 this.graphControlsGroupBox.Controls.Add(this.moveModeButton); 172 this.graphControlsGroupBox.Controls.Add(this.zoomModeButton); 173 this.graphControlsGroupBox.Location = new System.Drawing.Point(1, -2); 174 this.graphControlsGroupBox.Name = "graphControlsGroupBox"; 175 this.graphControlsGroupBox.Size = new System.Drawing.Size(202, 44); 176 this.graphControlsGroupBox.TabIndex = 11; 177 this.graphControlsGroupBox.TabStop = false; 178 this.graphControlsGroupBox.Text = "Graph controls"; 179 // 180 // lockGenealogyCheckBox 181 // 182 this.lockGenealogyCheckBox.Appearance = System.Windows.Forms.Appearance.Button; 183 this.lockGenealogyCheckBox.Location = new System.Drawing.Point(156, 14); 184 this.lockGenealogyCheckBox.Name = "lockGenealogyCheckBox"; 185 this.lockGenealogyCheckBox.Size = new System.Drawing.Size(24, 24); 186 this.lockGenealogyCheckBox.TabIndex = 17; 187 this.toolTip.SetToolTip(this.lockGenealogyCheckBox, "Lock genealogy"); 188 this.lockGenealogyCheckBox.UseVisualStyleBackColor = true; 189 this.lockGenealogyCheckBox.CheckedChanged += new System.EventHandler(this.lockGenealogyCheckBox_CheckedChanged); 190 // 191 // highlightAllButton 192 // 193 this.highlightAllButton.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 194 this.highlightAllButton.Location = new System.Drawing.Point(96, 14); 195 this.highlightAllButton.Name = "highlightAllButton"; 196 this.highlightAllButton.Size = new System.Drawing.Size(24, 24); 197 this.highlightAllButton.TabIndex = 13; 198 this.toolTip.SetToolTip(this.highlightAllButton, "Fitness gradient"); 199 this.highlightAllButton.UseVisualStyleBackColor = true; 200 this.highlightAllButton.Click += new System.EventHandler(this.highlightAllButton_Click); 201 // 202 // simpleLineagesCheckBox 203 // 204 this.simpleLineagesCheckBox.Appearance = System.Windows.Forms.Appearance.Button; 205 this.simpleLineagesCheckBox.Location = new System.Drawing.Point(126, 14); 206 this.simpleLineagesCheckBox.Name = "simpleLineagesCheckBox"; 207 this.simpleLineagesCheckBox.Size = new System.Drawing.Size(24, 24); 208 this.simpleLineagesCheckBox.TabIndex = 12; 209 this.toolTip.SetToolTip(this.simpleLineagesCheckBox, "Simple lineages"); 210 this.simpleLineagesCheckBox.UseVisualStyleBackColor = true; 211 this.simpleLineagesCheckBox.CheckedChanged += new System.EventHandler(this.simpleLineagesCheckBox_CheckedChanged); 198 212 // 199 213 // selectModeButton 200 214 // 201 215 this.selectModeButton.Appearance = System.Windows.Forms.Appearance.Button; 202 this.selectModeButton.Location = new System.Drawing.Point(6 3, 3);216 this.selectModeButton.Location = new System.Drawing.Point(66, 14); 203 217 this.selectModeButton.Name = "selectModeButton"; 204 218 this.selectModeButton.Size = new System.Drawing.Size(24, 24); 205 this.selectModeButton.TabIndex = 1 1;219 this.selectModeButton.TabIndex = 16; 206 220 this.selectModeButton.TabStop = true; 221 this.toolTip.SetToolTip(this.selectModeButton, "Select"); 207 222 this.selectModeButton.UseVisualStyleBackColor = true; 208 223 this.selectModeButton.CheckedChanged += new System.EventHandler(this.selectModeButton_CheckedChanged); … … 211 226 // 212 227 this.moveModeButton.Appearance = System.Windows.Forms.Appearance.Button; 213 this.moveModeButton.Location = new System.Drawing.Point( 3, 3);228 this.moveModeButton.Location = new System.Drawing.Point(6, 14); 214 229 this.moveModeButton.Name = "moveModeButton"; 215 230 this.moveModeButton.Size = new System.Drawing.Size(24, 24); 216 this.moveModeButton.TabIndex = 9;231 this.moveModeButton.TabIndex = 14; 217 232 this.moveModeButton.TabStop = true; 233 this.toolTip.SetToolTip(this.moveModeButton, "Move"); 218 234 this.moveModeButton.UseVisualStyleBackColor = true; 219 235 this.moveModeButton.CheckedChanged += new System.EventHandler(this.moveModeButton_CheckedChanged); … … 222 238 // 223 239 this.zoomModeButton.Appearance = System.Windows.Forms.Appearance.Button; 224 this.zoomModeButton.Location = new System.Drawing.Point(3 3, 3);240 this.zoomModeButton.Location = new System.Drawing.Point(36, 14); 225 241 this.zoomModeButton.Name = "zoomModeButton"; 226 242 this.zoomModeButton.Size = new System.Drawing.Size(24, 24); 227 this.zoomModeButton.TabIndex = 1 0;243 this.zoomModeButton.TabIndex = 15; 228 244 this.zoomModeButton.TabStop = true; 245 this.toolTip.SetToolTip(this.zoomModeButton, "Zoom"); 229 246 this.zoomModeButton.UseVisualStyleBackColor = true; 230 247 this.zoomModeButton.CheckedChanged += new System.EventHandler(this.zoomModeButton_CheckedChanged); … … 234 251 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 235 252 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 236 this.Controls.Add(this.mainTableLayout); 253 this.Controls.Add(this.splitContainer); 254 this.Controls.Add(this.topControlBox); 237 255 this.Name = "GenealogyGraphView"; 238 this.Size = new System.Drawing.Size(787, 584); 239 this.mainTableLayout.ResumeLayout(false); 256 this.Size = new System.Drawing.Size(1072, 778); 240 257 this.splitContainer.Panel1.ResumeLayout(false); 241 258 this.splitContainer.Panel2.ResumeLayout(false); 242 259 ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); 243 260 this.splitContainer.ResumeLayout(false); 244 this.genealogyTableLayout.ResumeLayout(false);245 261 this.topControlBox.ResumeLayout(false); 246 this.topControlBox.PerformLayout(); 247 this.graphControlsPanel.ResumeLayout(false); 262 this.groupBox1.ResumeLayout(false); 263 this.groupBox1.PerformLayout(); 264 this.graphControlsGroupBox.ResumeLayout(false); 248 265 this.ResumeLayout(false); 249 266 … … 252 269 #endregion 253 270 254 private System.Windows.Forms.TableLayoutPanel mainTableLayout;255 271 private System.Windows.Forms.SplitContainer splitContainer; 256 private System.Windows.Forms.GroupBox topControlBox; 257 private Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart symbolicExpressionTreeChart; 258 private System.Windows.Forms.TableLayoutPanel genealogyTableLayout; 272 private SymbolicExpressionTreeChart symbolicExpressionTreeChart; 273 259 274 private GenealogyGraphChart genealogyGraphChart; 260 private System.Windows.Forms.Panel graphControlsPanel; 275 private System.Windows.Forms.ToolTip toolTip; 276 private System.Windows.Forms.Panel topControlBox; 277 private System.Windows.Forms.GroupBox groupBox1; 278 private System.Windows.Forms.CheckBox matchConstantsCheckBox; 279 private System.Windows.Forms.CheckBox matchVariableWeightsCheckBox; 280 private System.Windows.Forms.CheckBox matchVariableNamesCheckBox; 281 private System.Windows.Forms.GroupBox graphControlsGroupBox; 282 private System.Windows.Forms.Button highlightAllButton; 283 private System.Windows.Forms.CheckBox simpleLineagesCheckBox; 261 284 private System.Windows.Forms.RadioButton selectModeButton; 262 285 private System.Windows.Forms.RadioButton moveModeButton; 263 286 private System.Windows.Forms.RadioButton zoomModeButton; 264 private System.Windows.Forms.Label similarityLabel; 265 private System.Windows.Forms.CheckBox matchVariableNamesCheckBox; 266 private System.Windows.Forms.CheckBox matchVariableWeightsCheckBox; 267 private System.Windows.Forms.CheckBox matchConstantsCheckBox; 287 private System.Windows.Forms.CheckBox lockGenealogyCheckBox; 268 288 269 289 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/GenealogyGraphView.cs
r9250 r9420 52 52 this.zoomModeButton.Image = Common.Resources.VSImageLibrary.Zoom; 53 53 this.selectModeButton.Image = Common.Resources.VSImageLibrary.Object; 54 this.highlightAllButton.Image = Common.Resources.VSImageLibrary.Gradient; 55 this.simpleLineagesCheckBox.Image = Common.Resources.VSImageLibrary.ArrowDown; 56 this.lockGenealogyCheckBox.Image = Common.Resources.VSImageLibrary.ProtectForm; 57 54 58 comparer = new SymbolicExpressionTreeNodeSimilarityComparer { 55 59 MatchConstantValues = true, … … 63 67 genealogyGraphChart.GenealogyGraphNodeClicked -= graphChart_GenealogyGraphNodeClicked; 64 68 symbolicExpressionTreeChart.SymbolicExpressionTreeNodeClicked -= treeChart_SymbolicExpressionTreeNodeClicked; 69 symbolicExpressionTreeChart.SymbolicExpressionTreeNodeDoubleClicked -= treeChart_SymbolicExpressionTreeNodeDoubleClicked; 70 Content.GraphUpdated -= genealogyGraphUpdated; 65 71 base.DeregisterContentEvents(); 66 72 } … … 72 78 symbolicExpressionTreeChart.SymbolicExpressionTreeNodeClicked += treeChart_SymbolicExpressionTreeNodeClicked; 73 79 symbolicExpressionTreeChart.SymbolicExpressionTreeNodeDoubleClicked += treeChart_SymbolicExpressionTreeNodeDoubleClicked; 80 Content.GraphUpdated += genealogyGraphUpdated; 74 81 } 75 82 … … 82 89 else { 83 90 genealogyGraphChart.Graph = Content; 84 var best = Content.Nodes.OrderByDescending(x => x.Quality).First();85 symbolicExpressionTreeChart.Tree = best.SymbolicExpressionTree;91 // var best = Content.Nodes.OrderByDescending(x => x.Quality).First(); 92 // symbolicExpressionTreeChart.Tree = best.SymbolicExpressionTree; 86 93 } 87 94 } … … 105 112 symbolicExpressionTreeChart.Tree = genealogyGraphNode.SymbolicExpressionTree; 106 113 if (genealogyGraphNode.InEdges == null) return; 107 var arc = genealogyGraphNode.InEdges. First(x => x.Source != x.Target);114 var arc = genealogyGraphNode.InEdges.Last(x => x.Source != x.Target); 108 115 if (arc == null || arc.Data == null) return; 109 116 var fragment = (IFragment)arc.Data; … … 113 120 visualSymbExprTreeNode.LineColor = Color.OrangeRed; 114 121 } 115 symbolicExpressionTreeChart.Repaint(); // pain orange nodes122 symbolicExpressionTreeChart.Repaint(); 116 123 } 117 124 … … 129 136 var btn = (RadioButton)sender; 130 137 if (btn.Checked) { genealogyGraphChart.Chart.Mode = ChartMode.Select; } 138 } 139 140 private void genealogyGraphUpdated(object sender, EventArgs args) { 141 genealogyGraphChart.Graph = Content; 131 142 } 132 143 … … 159 170 var selectedClone = clonedNodes[selectedNode]; 160 171 var parent = selectedClone.Parent; 172 if (parent == null) break; 173 int index = parent.IndexOfSubtree(selectedClone); 174 if (index == -1) break; 161 175 parent.RemoveSubtree(parent.IndexOfSubtree(selectedClone)); 162 176 foreach (var node in selectedNode.IterateNodesPrefix()) { … … 179 193 var fragment = new Fragment(clonedNodes[selectedVisualSymbExprTreeNode.SymbolicExpressionTreeNode]); 180 194 var fragmentLength = fragment.Length; 195 // highlight nodes 181 196 genealogyGraphChart.HighlightNodes(from node in genealogyGraphChart.Graph.Nodes 182 197 let tree = node.SymbolicExpressionTree 183 198 where tree.Length >= fragmentLength 184 199 where tree.Root.ContainsFragment(fragment, comparer) 185 select tree, Color.DodgerBlue); 200 select tree); 201 // highlight edges that contain a matching fragment 202 var fragmentSimilarityComparer = new SymbolicExpressionTreeFragmentSimilarityComparer { 203 SimilarityComparer = comparer 204 }; 205 var matchingEdges = genealogyGraphChart.Graph.Nodes.Where(n => n.InEdges != null) 206 .SelectMany(n => n.InEdges).Where(edge => edge.Data != null && ((IFragment)edge.Data).Root != null) 207 .Where(edge => fragmentSimilarityComparer.Equals(fragment, (IFragment)edge.Data)); 208 genealogyGraphChart.HighlightArcs(matchingEdges, Color.DodgerBlue); 209 210 186 211 genealogyGraphChart.Chart.UpdateEnabled = true; 187 212 genealogyGraphChart.Chart.EnforceUpdate(); … … 191 216 } 192 217 #endregion 218 193 219 private void matchConstantsCheckBox_CheckedChanged(object sender, EventArgs e) { 194 220 comparer.MatchConstantValues = matchConstantsCheckBox.Checked; … … 208 234 MatchNodesAndRepaint(); 209 235 } 236 237 private void simpleLineagesCheckBox_CheckedChanged(object sender, EventArgs e) { 238 genealogyGraphChart.SimpleLineages = simpleLineagesCheckBox.Checked; 239 } 240 241 private void highlightAllButton_Click(object sender, EventArgs e) { 242 symbolicExpressionTreeChart.Repaint(); 243 genealogyGraphChart.HighlightAll(); 244 } 245 246 private void lockGenealogyCheckBox_CheckedChanged(object sender, EventArgs e) { 247 genealogyGraphChart.LockGenealogy = lockGenealogyCheckBox.Checked; 248 } 210 249 } 211 250 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/HeuristicLab.EvolutionaryTracking.Views-3.4.csproj
r9296 r9420 18 18 <DebugType>full</DebugType> 19 19 <Optimize>false</Optimize> 20 <OutputPath>..\..\..\..\ Trunk\sources\bin\</OutputPath>20 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 21 21 <DefineConstants>DEBUG;TRACE</DefineConstants> 22 22 <ErrorReport>prompt</ErrorReport> … … 39 39 <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> 40 40 <DebugSymbols>true</DebugSymbols> 41 <OutputPath> bin\x64\Debug\</OutputPath>41 <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath> 42 42 <DefineConstants>DEBUG;TRACE</DefineConstants> 43 43 <DebugType>full</DebugType> … … 58 58 <Reference Include="HeuristicLab.Common-3.3"> 59 59 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath> 60 </Reference> 61 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL" /> 60 <Private>False</Private> 61 </Reference> 62 <Reference Include="HeuristicLab.Common.Resources-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 63 <Private>False</Private> 64 </Reference> 62 65 <Reference Include="HeuristicLab.Core-3.3"> 63 66 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath> 67 <Private>False</Private> 64 68 </Reference> 65 69 <Reference Include="HeuristicLab.Core.Views-3.3"> 66 70 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath> 67 </Reference> 68 <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 69 <SpecificVersion>False</SpecificVersion> 70 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath> 71 <Private>False</Private> 71 72 </Reference> 72 73 <Reference Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 73 74 <SpecificVersion>False</SpecificVersion> 74 75 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views-3.4.dll</HintPath> 76 <Private>False</Private> 75 77 </Reference> 76 78 <Reference Include="HeuristicLab.MainForm-3.3"> 77 79 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath> 80 <Private>False</Private> 78 81 </Reference> 79 82 <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3"> 80 83 <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath> 84 <Private>False</Private> 81 85 </Reference> 82 86 <Reference Include="HeuristicLab.PluginInfrastructure-3.3"> 83 87 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath> 88 <Private>False</Private> 84 89 </Reference> 85 90 <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 86 91 <SpecificVersion>False</SpecificVersion> 87 92 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath> 93 <Private>False</Private> 88 94 </Reference> 89 95 <Reference Include="HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 90 96 <SpecificVersion>False</SpecificVersion> 91 97 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis.Symbolic.Regression-3.4.dll</HintPath> 98 <Private>False</Private> 92 99 </Reference> 93 100 <Reference Include="HeuristicLab.Visualization-3.3, Version=3.3.0.5170, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL"> 94 101 <SpecificVersion>False</SpecificVersion> 95 102 <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Visualization-3.3.dll</HintPath> 103 <Private>False</Private> 96 104 </Reference> 97 105 <Reference Include="System" /> … … 112 120 <DependentUpon>FrequentFragmentsDialog.cs</DependentUpon> 113 121 </Compile> 114 <Compile Include="GenealogyGraphChart.cs" /> 122 <Compile Include="GenealogyGraphChart.cs"> 123 <SubType>UserControl</SubType> 124 </Compile> 115 125 <Compile Include="GenealogyGraphChart.Designer.cs"> 116 126 <DependentUpon>GenealogyGraphChart.cs</DependentUpon> … … 143 153 <Compile Include="VisualGenealogyGraphArc.cs" /> 144 154 <Compile Include="VisualGenealogyGraphNode.cs" /> 145 </ItemGroup> 146 <ItemGroup> 155 <Compile Include="VisualGenealogyGraphTextLabel.cs" /> 156 </ItemGroup> 157 <ItemGroup> 158 <ProjectReference Include="..\..\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding\3.4\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.csproj"> 159 <Project>{06d4a186-9319-48a0-bade-a2058d462eea}</Project> 160 <Name>HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4</Name> 161 <Private>False</Private> 162 </ProjectReference> 147 163 <ProjectReference Include="..\..\HeuristicLab.EvolutionaryTracking\3.4\HeuristicLab.EvolutionaryTracking-3.4.csproj"> 148 164 <Project>{1f75cea3-464f-4a6f-b2f0-04b9841ebc16}</Project> 149 165 <Name>HeuristicLab.EvolutionaryTracking-3.4</Name> 166 <Private>False</Private> 150 167 </ProjectReference> 151 168 <ProjectReference Include="..\..\HeuristicLab.Problems.DataAnalysis.Symbolic\3.4\HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj"> 152 169 <Project>{3D28463F-EC96-4D82-AFEE-38BE91A0CA00}</Project> 153 170 <Name>HeuristicLab.Problems.DataAnalysis.Symbolic-3.4</Name> 171 <Private>False</Private> 154 172 </ProjectReference> 155 173 </ItemGroup> … … 160 178 <EmbeddedResource Include="FrequentFragmentsDialog.resx"> 161 179 <DependentUpon>FrequentFragmentsDialog.cs</DependentUpon> 180 </EmbeddedResource> 181 <EmbeddedResource Include="GenealogyGraphChart.resx"> 182 <DependentUpon>GenealogyGraphChart.cs</DependentUpon> 162 183 </EmbeddedResource> 163 184 <EmbeddedResource Include="GenealogyGraphDialog.resx"> -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/LineageExplorerView.Designer.cs
r9250 r9420 25 25 private void InitializeComponent() { 26 26 this.components = new System.ComponentModel.Container(); 27 this.tabControl1 = new System.Windows.Forms.TabControl(); 28 this.tabPage1 = new System.Windows.Forms.TabPage(); 29 this.tabPage2 = new System.Windows.Forms.TabPage(); 27 30 this.panel1 = new System.Windows.Forms.Panel(); 28 31 this.qualityImprovementTreeView = new System.Windows.Forms.TreeView(); 29 32 this.symbolicExpressionTreeChart = new HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart(); 30 33 this.scopeListTreeView = new System.Windows.Forms.TreeView(); 34 this.calculateFragmentFrequencyButton = new System.Windows.Forms.Button(); 35 this.showGenealogyButton = new System.Windows.Forms.Button(); 36 this.button1 = new System.Windows.Forms.Button(); 31 37 this.panel2 = new System.Windows.Forms.Panel(); 32 this.showGenealogyButton = new System.Windows.Forms.Button(); 33 this.calculateFragmentFrequencyButton = new System.Windows.Forms.Button(); 38 this.panel3 = new System.Windows.Forms.Panel(); 39 this.showFrequentFragmentsButton = new System.Windows.Forms.Button(); 40 this.textBox2 = new System.Windows.Forms.TextBox(); 41 this.thresholdLabel = new System.Windows.Forms.Label(); 42 this.bestNTextBox = new System.Windows.Forms.TextBox(); 43 this.consideredTrees = new System.Windows.Forms.Label(); 44 this.panel4 = new System.Windows.Forms.Panel(); 45 this.tabControl1.SuspendLayout(); 46 this.tabPage1.SuspendLayout(); 47 this.tabPage2.SuspendLayout(); 34 48 this.panel1.SuspendLayout(); 35 49 this.panel2.SuspendLayout(); 50 this.panel3.SuspendLayout(); 36 51 this.SuspendLayout(); 37 52 // 53 // tabControl1 54 // 55 this.tabControl1.Controls.Add(this.tabPage1); 56 this.tabControl1.Controls.Add(this.tabPage2); 57 this.tabControl1.Dock = System.Windows.Forms.DockStyle.Fill; 58 this.tabControl1.Location = new System.Drawing.Point(0, 0); 59 this.tabControl1.Name = "tabControl1"; 60 this.tabControl1.SelectedIndex = 0; 61 this.tabControl1.Size = new System.Drawing.Size(1016, 669); 62 this.tabControl1.TabIndex = 2; 63 // 64 // tabPage1 65 // 66 this.tabPage1.Controls.Add(this.panel1); 67 this.tabPage1.Controls.Add(this.panel2); 68 this.tabPage1.Location = new System.Drawing.Point(4, 22); 69 this.tabPage1.Name = "tabPage1"; 70 this.tabPage1.Padding = new System.Windows.Forms.Padding(3); 71 this.tabPage1.Size = new System.Drawing.Size(1008, 643); 72 this.tabPage1.TabIndex = 0; 73 this.tabPage1.Text = "Lineages"; 74 this.tabPage1.UseVisualStyleBackColor = true; 75 // 76 // tabPage2 77 // 78 this.tabPage2.Controls.Add(this.panel4); 79 this.tabPage2.Controls.Add(this.panel3); 80 this.tabPage2.Location = new System.Drawing.Point(4, 22); 81 this.tabPage2.Name = "tabPage2"; 82 this.tabPage2.Padding = new System.Windows.Forms.Padding(3); 83 this.tabPage2.Size = new System.Drawing.Size(1008, 643); 84 this.tabPage2.TabIndex = 1; 85 this.tabPage2.Text = "Fragments"; 86 this.tabPage2.UseVisualStyleBackColor = true; 87 // 38 88 // panel1 39 89 // 40 this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)41 | System.Windows.Forms.AnchorStyles.Left)42 | System.Windows.Forms.AnchorStyles.Right)));43 90 this.panel1.Controls.Add(this.qualityImprovementTreeView); 44 91 this.panel1.Controls.Add(this.symbolicExpressionTreeChart); 45 92 this.panel1.Controls.Add(this.scopeListTreeView); 46 this.panel1.Location = new System.Drawing.Point(3, 42); 93 this.panel1.Dock = System.Windows.Forms.DockStyle.Fill; 94 this.panel1.Location = new System.Drawing.Point(3, 36); 47 95 this.panel1.Name = "panel1"; 48 this.panel1.Size = new System.Drawing.Size( 503, 624);49 this.panel1.TabIndex = 0;96 this.panel1.Size = new System.Drawing.Size(1002, 604); 97 this.panel1.TabIndex = 1; 50 98 // 51 99 // qualityImprovementTreeView … … 54 102 | System.Windows.Forms.AnchorStyles.Right))); 55 103 this.qualityImprovementTreeView.HideSelection = false; 56 this.qualityImprovementTreeView.Location = new System.Drawing.Point( 388, 0);104 this.qualityImprovementTreeView.Location = new System.Drawing.Point(887, 0); 57 105 this.qualityImprovementTreeView.Name = "qualityImprovementTreeView"; 58 this.qualityImprovementTreeView.Size = new System.Drawing.Size(115, 6 24);106 this.qualityImprovementTreeView.Size = new System.Drawing.Size(115, 604); 59 107 this.qualityImprovementTreeView.TabIndex = 10; 60 108 this.qualityImprovementTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.qualityImprovementTreeView_AfterSelect); … … 69 117 this.symbolicExpressionTreeChart.Location = new System.Drawing.Point(155, 0); 70 118 this.symbolicExpressionTreeChart.Name = "symbolicExpressionTreeChart"; 71 this.symbolicExpressionTreeChart.Size = new System.Drawing.Size( 227, 624);119 this.symbolicExpressionTreeChart.Size = new System.Drawing.Size(726, 604); 72 120 this.symbolicExpressionTreeChart.Spacing = 5; 73 121 this.symbolicExpressionTreeChart.SuspendRepaint = false; … … 75 123 this.symbolicExpressionTreeChart.TextFont = new System.Drawing.Font("Times New Roman", 8F); 76 124 this.symbolicExpressionTreeChart.Tree = null; 77 this.symbolicExpressionTreeChart.SymbolicExpressionTreeNodeClicked += new System.Windows.Forms.MouseEventHandler(this.symbolicExpressionTreeChart_SymbolicExpressionTreeNodeClicked);78 125 // 79 126 // scopeListTreeView … … 83 130 this.scopeListTreeView.Location = new System.Drawing.Point(0, 0); 84 131 this.scopeListTreeView.Name = "scopeListTreeView"; 85 this.scopeListTreeView.Size = new System.Drawing.Size(155, 6 24);132 this.scopeListTreeView.Size = new System.Drawing.Size(155, 604); 86 133 this.scopeListTreeView.TabIndex = 11; 87 134 this.scopeListTreeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.scopeListTreeView_AfterSelect); 88 135 // 89 // panel2 90 // 91 this.panel2.Controls.Add(this.showGenealogyButton); 92 this.panel2.Controls.Add(this.calculateFragmentFrequencyButton); 93 this.panel2.Dock = System.Windows.Forms.DockStyle.Top; 94 this.panel2.Location = new System.Drawing.Point(0, 0); 95 this.panel2.Name = "panel2"; 96 this.panel2.Size = new System.Drawing.Size(509, 33); 97 this.panel2.TabIndex = 1; 136 // calculateFragmentFrequencyButton 137 // 138 this.calculateFragmentFrequencyButton.AutoSize = true; 139 this.calculateFragmentFrequencyButton.Location = new System.Drawing.Point(4, 4); 140 this.calculateFragmentFrequencyButton.Name = "calculateFragmentFrequencyButton"; 141 this.calculateFragmentFrequencyButton.Size = new System.Drawing.Size(119, 23); 142 this.calculateFragmentFrequencyButton.TabIndex = 0; 143 this.calculateFragmentFrequencyButton.Text = "Fragment frequencies"; 144 this.calculateFragmentFrequencyButton.UseVisualStyleBackColor = true; 145 this.calculateFragmentFrequencyButton.Click += new System.EventHandler(this.calculateFragmentFrequencyButton_Click); 98 146 // 99 147 // showGenealogyButton … … 108 156 this.showGenealogyButton.Click += new System.EventHandler(this.showGenealogyButton_Click); 109 157 // 110 // calculateFragmentFrequencyButton 111 // 112 this.calculateFragmentFrequencyButton.AutoSize = true; 113 this.calculateFragmentFrequencyButton.Location = new System.Drawing.Point(4, 4); 114 this.calculateFragmentFrequencyButton.Name = "calculateFragmentFrequencyButton"; 115 this.calculateFragmentFrequencyButton.Size = new System.Drawing.Size(119, 23); 116 this.calculateFragmentFrequencyButton.TabIndex = 0; 117 this.calculateFragmentFrequencyButton.Text = "Fragment frequencies"; 118 this.calculateFragmentFrequencyButton.UseVisualStyleBackColor = true; 119 this.calculateFragmentFrequencyButton.Click += new System.EventHandler(this.calculateFragmentFrequencyButton_Click); 158 // button1 159 // 160 this.button1.AutoSize = true; 161 this.button1.Location = new System.Drawing.Point(239, 4); 162 this.button1.Name = "button1"; 163 this.button1.Size = new System.Drawing.Size(135, 23); 164 this.button1.TabIndex = 2; 165 this.button1.Text = "Show frequent fragments"; 166 this.button1.UseVisualStyleBackColor = true; 167 this.button1.Click += new System.EventHandler(this.button1_Click); 168 // 169 // panel2 170 // 171 this.panel2.Controls.Add(this.button1); 172 this.panel2.Controls.Add(this.showGenealogyButton); 173 this.panel2.Controls.Add(this.calculateFragmentFrequencyButton); 174 this.panel2.Dock = System.Windows.Forms.DockStyle.Top; 175 this.panel2.Location = new System.Drawing.Point(3, 3); 176 this.panel2.Name = "panel2"; 177 this.panel2.Size = new System.Drawing.Size(1002, 33); 178 this.panel2.TabIndex = 1; 179 // 180 // panel3 181 // 182 this.panel3.Controls.Add(this.showFrequentFragmentsButton); 183 this.panel3.Controls.Add(this.textBox2); 184 this.panel3.Controls.Add(this.thresholdLabel); 185 this.panel3.Controls.Add(this.bestNTextBox); 186 this.panel3.Controls.Add(this.consideredTrees); 187 this.panel3.Dock = System.Windows.Forms.DockStyle.Top; 188 this.panel3.Location = new System.Drawing.Point(3, 3); 189 this.panel3.Name = "panel3"; 190 this.panel3.Size = new System.Drawing.Size(1002, 30); 191 this.panel3.TabIndex = 0; 192 // 193 // showFrequentFragmentsButton 194 // 195 this.showFrequentFragmentsButton.AutoSize = true; 196 this.showFrequentFragmentsButton.Location = new System.Drawing.Point(218, 3); 197 this.showFrequentFragmentsButton.Name = "showFrequentFragmentsButton"; 198 this.showFrequentFragmentsButton.Size = new System.Drawing.Size(135, 23); 199 this.showFrequentFragmentsButton.TabIndex = 19; 200 this.showFrequentFragmentsButton.Text = "Show frequent fragments"; 201 this.showFrequentFragmentsButton.UseVisualStyleBackColor = true; 202 this.showFrequentFragmentsButton.Click += new System.EventHandler(this.showFrequentFragmentsButton_Click); 203 // 204 // textBox2 205 // 206 this.textBox2.Location = new System.Drawing.Point(173, 5); 207 this.textBox2.Name = "textBox2"; 208 this.textBox2.Size = new System.Drawing.Size(39, 20); 209 this.textBox2.TabIndex = 18; 210 this.textBox2.Text = "0.2"; 211 // 212 // thresholdLabel 213 // 214 this.thresholdLabel.AutoSize = true; 215 this.thresholdLabel.Location = new System.Drawing.Point(113, 9); 216 this.thresholdLabel.Name = "thresholdLabel"; 217 this.thresholdLabel.Size = new System.Drawing.Size(54, 13); 218 this.thresholdLabel.TabIndex = 17; 219 this.thresholdLabel.Text = "Threshold"; 220 // 221 // bestNTextBox 222 // 223 this.bestNTextBox.Location = new System.Drawing.Point(68, 6); 224 this.bestNTextBox.Name = "bestNTextBox"; 225 this.bestNTextBox.Size = new System.Drawing.Size(39, 20); 226 this.bestNTextBox.TabIndex = 16; 227 this.bestNTextBox.Text = "10"; 228 // 229 // consideredTrees 230 // 231 this.consideredTrees.AutoSize = true; 232 this.consideredTrees.Location = new System.Drawing.Point(3, 9); 233 this.consideredTrees.Name = "consideredTrees"; 234 this.consideredTrees.Size = new System.Drawing.Size(63, 13); 235 this.consideredTrees.TabIndex = 15; 236 this.consideredTrees.Text = "Best n trees"; 237 // 238 // panel4 239 // 240 this.panel4.Dock = System.Windows.Forms.DockStyle.Fill; 241 this.panel4.Location = new System.Drawing.Point(3, 33); 242 this.panel4.Name = "panel4"; 243 this.panel4.Size = new System.Drawing.Size(1002, 607); 244 this.panel4.TabIndex = 1; 120 245 // 121 246 // LineageExplorerView … … 123 248 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 124 249 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 125 this.Controls.Add(this.panel2); 126 this.Controls.Add(this.panel1); 250 this.Controls.Add(this.tabControl1); 127 251 this.Name = "LineageExplorerView"; 128 this.Size = new System.Drawing.Size(509, 669); 252 this.Size = new System.Drawing.Size(1016, 669); 253 this.tabControl1.ResumeLayout(false); 254 this.tabPage1.ResumeLayout(false); 255 this.tabPage2.ResumeLayout(false); 129 256 this.panel1.ResumeLayout(false); 130 257 this.panel2.ResumeLayout(false); 131 258 this.panel2.PerformLayout(); 259 this.panel3.ResumeLayout(false); 260 this.panel3.PerformLayout(); 132 261 this.ResumeLayout(false); 133 262 … … 136 265 #endregion 137 266 267 private System.Windows.Forms.TabControl tabControl1; 268 private System.Windows.Forms.TabPage tabPage1; 138 269 private System.Windows.Forms.Panel panel1; 139 private System.Windows.Forms.Panel panel2;140 private System.Windows.Forms.Button calculateFragmentFrequencyButton;141 270 private System.Windows.Forms.TreeView qualityImprovementTreeView; 142 271 private Encodings.SymbolicExpressionTreeEncoding.Views.SymbolicExpressionTreeChart symbolicExpressionTreeChart; 143 272 private System.Windows.Forms.TreeView scopeListTreeView; 273 private System.Windows.Forms.TabPage tabPage2; 274 private System.Windows.Forms.Panel panel2; 275 private System.Windows.Forms.Button button1; 144 276 private System.Windows.Forms.Button showGenealogyButton; 277 private System.Windows.Forms.Button calculateFragmentFrequencyButton; 278 private System.Windows.Forms.Panel panel3; 279 private System.Windows.Forms.Button showFrequentFragmentsButton; 280 private System.Windows.Forms.TextBox textBox2; 281 private System.Windows.Forms.Label thresholdLabel; 282 private System.Windows.Forms.TextBox bestNTextBox; 283 private System.Windows.Forms.Label consideredTrees; 284 private System.Windows.Forms.Panel panel4; 285 145 286 146 287 -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/LineageExplorerView.cs
r9250 r9420 7 7 using HeuristicLab.Core.Views; 8 8 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 9 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views; 9 10 using HeuristicLab.MainForm; 10 11 using HeuristicLab.Problems.DataAnalysis.Symbolic; … … 17 18 private List<SymbolicExpressionGenealogyGraphNode> lineage; 18 19 20 private Dictionary<ISymbolicExpressionTree, Dictionary<ISymbolicExpressionTreeNode, double>> fragmentFrequencies; 21 19 22 public new LineageExplorer Content { 20 23 get { return (LineageExplorer)base.Content; } … … 66 69 var treeNode = scopeListTreeView.SelectedNode; 67 70 var symbExprTree = treeMap[treeNode]; 71 72 fragmentFrequencies = fragmentFrequencies ?? new Dictionary<ISymbolicExpressionTree, Dictionary<ISymbolicExpressionTreeNode, double>>(); 73 74 if (fragmentFrequencies.ContainsKey(symbExprTree) && false) { 75 // colorize tree nodes according to fragment frequencies 76 symbolicExpressionTreeChart.SuspendRepaint = true; 77 var frequencies = fragmentFrequencies[symbExprTree]; 78 79 foreach (var node in symbExprTree.IterateNodesBreadth()) { 80 double freq = frequencies[node]; 81 int index = (int)Math.Floor(freq * ColorGradient.Colors.Count / scopeListTreeView.GetNodeCount(false)); 82 if (index == ColorGradient.Colors.Count) index--; 83 var color = ColorGradient.Colors[index]; 84 var visualNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node); 85 visualNode.FillColor = Color.FromArgb(200, color); 86 } 87 symbolicExpressionTreeChart.SuspendRepaint = false; 88 symbolicExpressionTreeChart.Repaint(); 89 } 90 // highlight crossover fragment 68 91 HighlightFragment(symbExprTree); 69 92 70 var graphNode = Content.GenealogyGraph.GetGraphNodes(symbExprTree). First();93 var graphNode = Content.GenealogyGraph.GetGraphNodes(symbExprTree).Last(); 71 94 lineage = lineage ?? new List<SymbolicExpressionGenealogyGraphNode>(); 72 95 lineage.Clear(); … … 78 101 lineage.Add(gn); 79 102 } 80 lineage.Reverse(); // incre sing order by generation103 lineage.Reverse(); // increasing order by generation 81 104 82 105 // update the righthand side tree view … … 108 131 return; 109 132 } 110 var fragment = (IFragment)graphNode.InEdges[0].Data;133 var fragment = graphNode.InEdges.Count == 1 ? (IFragment)graphNode.InEdges[0].Data : (IFragment)graphNode.InEdges[1].Data; 111 134 if (fragment.Root == null) { 112 135 symbolicExpressionTreeChart.SuspendRepaint = false; … … 130 153 // the individual can occur multiple times in the graph if it is(was) elite. we take the first occurence. 131 154 var graphNode = Content.GenealogyGraph.GetGraphNodes(symbolicExpressionTreeChart.Tree).First(); 155 var trees = Content.GenealogyGraph.Nodes.Where(x => x.Rank.IsAlmost(graphNode.Rank)).Select(x => x.SymbolicExpressionTree).ToList(); 156 132 157 var fragments = graphNode.SymbolicExpressionTree.IterateNodesBreadth().Select(n => new Fragment(n)); 133 var trees = Content.Trees.Select(t => t.Item1).ToList();134 var hashset = new HashSet<ISymbolicExpressionTree>();135 158 136 159 var similarityComparer = new SymbolicExpressionTreeNodeSimilarityComparer { … … 140 163 }; 141 164 165 var canonicalSorter = new SymbolicExpressionTreeCanonicalSorter(); 166 167 fragmentFrequencies = fragmentFrequencies ?? new Dictionary<ISymbolicExpressionTree, Dictionary<ISymbolicExpressionTreeNode, double>>(); 168 169 if (!fragmentFrequencies.ContainsKey(graphNode.SymbolicExpressionTree)) { 170 fragmentFrequencies[graphNode.SymbolicExpressionTree] = new Dictionary<ISymbolicExpressionTreeNode, double>(); 171 } 172 173 fragmentFrequencies[graphNode.SymbolicExpressionTree].Clear(); 174 142 175 symbolicExpressionTreeChart.SuspendRepaint = true; 143 176 foreach (var f in fragments) { 144 177 double freq = 0; 178 145 179 foreach (var t in trees) { 146 180 if (t.Root.ContainsFragment(f, similarityComparer)) ++freq; 147 int index = (int)Math.Floor(freq * ColorGradient.Colors.Count / trees.Count); 148 if (index == ColorGradient.Colors.Count) index--; 149 var color = ColorGradient.Colors[index]; 150 foreach (var node in f.Root.IterateNodesBreadth()) { 151 var visualNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node); 152 visualNode.FillColor = Color.FromArgb(200, color); 153 } 154 } 155 } 181 } 182 183 fragmentFrequencies[graphNode.SymbolicExpressionTree].Add(f.Root, freq); 184 185 // colorize tree nodes according to fragment frequencies 186 int index = (int)Math.Floor(freq * ColorGradient.Colors.Count / trees.Count); 187 if (index == ColorGradient.Colors.Count) index--; 188 var color = ColorGradient.Colors[index]; 189 foreach (var node in f.Root.IterateNodesBreadth()) { 190 var visualNode = symbolicExpressionTreeChart.GetVisualSymbolicExpressionTreeNode(node); 191 visualNode.FillColor = Color.FromArgb(200, color); 192 } 193 } 194 156 195 symbolicExpressionTreeChart.SuspendRepaint = false; 157 196 symbolicExpressionTreeChart.Repaint(); … … 172 211 } 173 212 using (var dialog = new GenealogyGraphDialog { Graph = graph }) { 213 dialog.ShowDialog(this); 214 } 215 } 216 217 private void button1_Click(object sender, EventArgs e) { 218 using (var dialog = new FrequentFragmentsDialog()) { 219 var panel = new Panel { Dock = DockStyle.Left, Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom }; 220 221 panel.Controls.Add(new SymbolicExpressionTreeChart() { Tree = treeMap.Values.First() }); 222 panel.Controls.Add(new Label { Text = "Fragment frequency." }); 223 224 dialog.fragmentsPanel.Controls.Add(panel); 225 226 dialog.ShowDialog(this); 227 } 228 } 229 230 private void showFrequentFragmentsButton_Click(object sender, EventArgs e) { 231 int bestN; 232 bool success = int.TryParse(bestNTextBox.Text, out bestN); 233 if (!success) bestN = 10; 234 var tuples = Content.Trees.Select(t => new { Tree = t.Item1, Quality = t.Item2 }).OrderByDescending(x => x.Quality).ToList(); 235 var bestTrees = tuples.Take(bestN).Select(x => x.Tree).ToList(); 236 237 var similarityComparer = new SymbolicExpressionTreeNodeSimilarityComparer { 238 MatchConstantValues = false, 239 MatchVariableNames = true, 240 MatchVariableWeights = false 241 }; 242 243 var fragments = bestTrees.SelectMany(t => t.IterateNodesBreadth()).Where(n => n.GetLength() >= 3).Distinct(similarityComparer).Select(n => new Fragment(n)); 244 245 double bestNQuality = tuples.Take(bestN).Sum(x => x.Quality); // average quality of best N individuals in the population 246 247 using (var dialog = new FrequentFragmentsDialog()) { 248 foreach (var fragment in fragments.Take(20)) { 249 double avgQuality = bestNQuality; 250 double frequency = bestN; 251 foreach (var t in tuples.Skip(bestN)) { 252 var tree = t.Tree; 253 if (tree.Root.ContainsFragment(fragment, similarityComparer)) { 254 avgQuality += t.Quality; 255 frequency++; 256 } 257 } 258 if (frequency > 0.2) { 259 var panel = new Panel { 260 Dock = DockStyle.Left, 261 Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Bottom 262 }; 263 264 panel.Controls.Add(new SymbolicExpressionTreeChart() { Tree = treeMap.Values.First() }); 265 panel.Controls.Add(new Label { Text = "Fragment frequency." }); 266 267 dialog.fragmentsPanel.Controls.Add(panel); 268 } 269 } 174 270 dialog.ShowDialog(this); 175 271 } -
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking.Views/3.4/VisualGenealogyGraphNode.cs
r9084 r9420 38 38 get { return outgoingArcs; } 39 39 set { outgoingArcs = value; } 40 } 41 42 public float LineWidth { 43 get { return Pen.Width; } 44 set { Pen.Width = value; } 40 45 } 41 46
Note: See TracChangeset
for help on using the changeset viewer.