- Timestamp:
- 03/25/14 17:17:52 (11 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking
- Files:
-
- 4 added
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/Formatters/SymbolicExpressionTreeLatexFormatter.cs
r10649 r10655 35 35 { 36 36 {"ProgramRootSymbol", "Prog"}, 37 {"StartSymbol","RPB"} 37 {"StartSymbol","RPB"}, 38 {"Multiplication", "$\\times$"}, 39 {"Division", "$\\div$"}, 40 {"Addition", "$+$"}, 41 {"Subtraction", "$-$"}, 42 {"Exponential", "$\\exp$"}, 43 {"Logarithm", "$\\log$"} 38 44 }; 39 45 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeTile.cs
r10650 r10655 28 28 29 29 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views { 30 /// <summary> 31 /// The SymbolicExpressionTreeTile will display either a full tree or just a subtree (case in which the SymbolicExpressionTreeProperty remains unset). 32 /// By setting the Root property, the user can use the SymbolicExpressionTreeTile to layout and display arbitrary subtrees. 33 /// </summary> 30 34 public class SymbolicExpressionTreeTile : Group { 31 35 public double PreferredNodeWidth { get; set; } … … 36 40 set { 37 41 symbolicExpressionTree = value; 42 Root = symbolicExpressionTree.Root; 43 } 44 } 45 46 new private void Clear() { 47 Group.Clear(); 48 primitiveMap.Clear(); 49 } 50 51 private ISymbolicExpressionTreeNode root; 52 public ISymbolicExpressionTreeNode Root { 53 get { return root; } 54 set { 55 root = value; 38 56 GeneratePrimitives(PreferredNodeWidth, PreferredNodeHeight); 39 57 } 40 58 } 41 42 59 public ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> LayoutEngine { get; set; } 43 60 private Dictionary<IPrimitive, ISymbolicExpressionTreeNode> primitiveMap; … … 55 72 private void GeneratePrimitives(double preferredNodeWidth, double preferredNodeHeight) { 56 73 Clear(); 57 ISymbolicExpressionTreeNode root = SymbolicExpressionTree.Root;74 ISymbolicExpressionTreeNode root = Root; 58 75 if (root.Symbol is ProgramRootSymbol && root.SubtreeCount == 1) { root = root.GetSubtree(0); } 59 76 var visualNodes = LayoutEngine.CalculateLayout(root); … … 74 91 } 75 92 93 primitiveMap.Add(rectangularPrimitive, node); // to be able to retrieve nodes via primitives 76 94 this.Add(rectangularPrimitive); 77 95 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj
r10650 r10655 193 193 <ItemGroup> 194 194 <Compile Include="Exporters\SymbolicSolutionExcelExporter.cs" /> 195 <Compile Include="FragmentGraphView.cs"> 196 <SubType>UserControl</SubType> 197 </Compile> 198 <Compile Include="FragmentGraphView.Designer.cs"> 199 <DependentUpon>FragmentGraphView.cs</DependentUpon> 200 </Compile> 195 201 <Compile Include="InteractiveSymbolicExpressionTreeChart.cs"> 196 202 <SubType>UserControl</SubType> … … 231 237 <DependentUpon>SymbolicDataAnalysisExpressionGenealogyGraphChart.cs</DependentUpon> 232 238 </Compile> 233 <Compile Include="Symbolic DataAnalysisExpressionLineageExplorerChart.cs">234 <SubType>UserControl</SubType> 235 </Compile> 236 <Compile Include="Symbolic DataAnalysisExpressionLineageExplorerChart.Designer.cs">237 <DependentUpon>Symbolic DataAnalysisExpressionLineageExplorerChart.cs</DependentUpon>239 <Compile Include="SymbolicExpressionChartControl.cs"> 240 <SubType>UserControl</SubType> 241 </Compile> 242 <Compile Include="SymbolicExpressionChartControl.Designer.cs"> 243 <DependentUpon>SymbolicExpressionChartControl.cs</DependentUpon> 238 244 </Compile> 239 245 <Compile Include="SymbolicDataAnalysisExpressionLineageExplorerView.cs"> -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymboldDataAnalysisGenealogyView.cs
r10654 r10655 98 98 var fragmentGraph = TraceSubtree(subtree); 99 99 100 // find all the genealogy graph nodes that contain the building blocks which formed the currently selected subtree 101 // this should maybe be limited to nodes of the ancestry (can be very computationally expensive) 102 var vertices = from x in fragmentGraph.Nodes 103 let fragmentNode = (FragmentNode)x 104 let fragment = fragmentNode.Content 105 from y in Content.Nodes 106 let graphNode = (IGenealogyGraphNode<ISymbolicExpressionTree>)y 107 let tree = graphNode.Content 108 where tree.Root.ContainsSubtree(fragment.Root, comparer) 109 select graphNode; 110 111 graphChart_highlightMatchingVertices(vertices); 100 // open a FragmentGraphView displaying this fragmentGraph 112 101 } else { 113 102 // perform matching like it was done before … … 186 175 var fragmentLength = fragment.Root.GetLength(); 187 176 177 178 // below, we consider three cases: 179 // 1) the selected subtree is the same as the fragment 180 // 2) the fragment contains the selected subtree 181 // 3) the fragment is contained by the selected subtree 182 // In each case, the idea is to isolate and individually track the fragment and the rest of the subtree (for cases 2 and 3) 188 183 if (fragment.Index == index) { 189 184 // the selected subtree is the actual fragment -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisExpressionLineageExplorerView.Designer.cs
r10517 r10655 25 25 private void InitializeComponent() { 26 26 this.treeView = new System.Windows.Forms.TreeView(); 27 this. lineageExplorerChart = new HeuristicLab.Problems.DataAnalysis.Symbolic.Views.SymbolicDataAnalysisExpressionLineageExplorerChart();27 this.symbolicExpressionChartControl = new HeuristicLab.Problems.DataAnalysis.Symbolic.Views.SymbolicExpressionChartControl(); 28 28 this.SuspendLayout(); 29 29 // 30 30 // treeView 31 31 // 32 this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 32 this.treeView.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 33 33 | System.Windows.Forms.AnchorStyles.Left))); 34 34 this.treeView.Location = new System.Drawing.Point(3, 3); … … 38 38 this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_AfterSelect); 39 39 // 40 // lineageExplorerChart40 // symbolicExpressionChartControl 41 41 // 42 this. lineageExplorerChart.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)43 | System.Windows.Forms.AnchorStyles.Left) 42 this.symbolicExpressionChartControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 43 | System.Windows.Forms.AnchorStyles.Left) 44 44 | System.Windows.Forms.AnchorStyles.Right))); 45 this. lineageExplorerChart.AutoSize = true;46 this. lineageExplorerChart.BackColor = System.Drawing.SystemColors.Control;47 this. lineageExplorerChart.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;48 this. lineageExplorerChart.Chart = null;49 this. lineageExplorerChart.Location = new System.Drawing.Point(176, 3);50 this. lineageExplorerChart.Name = "lineageExplorerChart";51 this. lineageExplorerChart.ScaleOnResize = true;52 this. lineageExplorerChart.Size = new System.Drawing.Size(657, 593);53 this. lineageExplorerChart.TabIndex = 1;45 this.symbolicExpressionChartControl.AutoSize = true; 46 this.symbolicExpressionChartControl.BackColor = System.Drawing.SystemColors.Control; 47 this.symbolicExpressionChartControl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; 48 this.symbolicExpressionChartControl.Chart = null; 49 this.symbolicExpressionChartControl.Location = new System.Drawing.Point(176, 3); 50 this.symbolicExpressionChartControl.Name = "symbolicExpressionChartControl"; 51 this.symbolicExpressionChartControl.ScaleOnResize = true; 52 this.symbolicExpressionChartControl.Size = new System.Drawing.Size(657, 593); 53 this.symbolicExpressionChartControl.TabIndex = 1; 54 54 // 55 55 // SymbolicDataAnalysisExpressionLineageExplorerView … … 57 57 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 58 58 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 59 this.Controls.Add(this. lineageExplorerChart);59 this.Controls.Add(this.symbolicExpressionChartControl); 60 60 this.Controls.Add(this.treeView); 61 61 this.DoubleBuffered = true; … … 70 70 71 71 private System.Windows.Forms.TreeView treeView; 72 private Symbolic DataAnalysisExpressionLineageExplorerChart lineageExplorerChart;72 private SymbolicExpressionChartControl symbolicExpressionChartControl; 73 73 } 74 74 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisExpressionLineageExplorerView.cs
r10650 r10655 38 38 39 39 treeMap = new Dictionary<TreeNode, ISymbolicExpressionTree>(); 40 double width = lineageExplorerChart.PreferredSize.Width;41 double height = lineageExplorerChart.PreferredSize.Height;42 if ( lineageExplorerChart.Chart == null) {43 lineageExplorerChart.Chart = new Chart(0, 0, width, height);40 double width = symbolicExpressionChartControl.PreferredSize.Width; 41 double height = symbolicExpressionChartControl.PreferredSize.Height; 42 if (symbolicExpressionChartControl.Chart == null) { 43 symbolicExpressionChartControl.Chart = new Chart(0, 0, width, height); 44 44 } 45 45 } … … 60 60 var lastGen = Content.Ranks.OrderBy(x => x.Key).Last().Value.ToList(); 61 61 treeMap.Clear(); 62 lineageExplorerChart.Clear();62 symbolicExpressionChartControl.Clear(); 63 63 foreach (var g in lastGen) { 64 64 var treeNode = new TreeNode(g.Quality.ToString(CultureInfo.InvariantCulture)); … … 69 69 70 70 private void treeView_AfterSelect(object sender, TreeViewEventArgs e) { 71 lineageExplorerChart.Clear();71 symbolicExpressionChartControl.Clear(); 72 72 var selectedNode = treeView.SelectedNode; 73 73 var symbolicExpressionTree = treeMap[selectedNode]; 74 var chart = lineageExplorerChart.Chart;74 var chart = symbolicExpressionChartControl.Chart; 75 75 var tile = new SymbolicExpressionTreeTile(chart) { 76 76 LayoutEngine = symbolicExpressionTreeNodeLayoutEngine, … … 79 79 SymbolicExpressionTree = symbolicExpressionTree 80 80 }; 81 lineageExplorerChart.UpdateEnabled = false;82 lineageExplorerChart.Add(tile);83 lineageExplorerChart.FlipVertical();84 lineageExplorerChart.UpdateEnabled = true;85 lineageExplorerChart.EnforceUpdate();81 symbolicExpressionChartControl.UpdateEnabled = false; 82 symbolicExpressionChartControl.Add(tile); 83 symbolicExpressionChartControl.FlipVertical(); 84 symbolicExpressionChartControl.UpdateEnabled = true; 85 symbolicExpressionChartControl.EnforceUpdate(); 86 86 } 87 87 }
Note: See TracChangeset
for help on using the changeset viewer.