Free cookie consent management tool by TermsFeed Policy Generator

Changeset 10655 for branches


Ignore:
Timestamp:
03/25/14 17:17:52 (10 years ago)
Author:
bburlacu
Message:

#1772: Made some progress towards the visualization of building block trajectories. Added the FragmentGraphView.

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  
    3535    {
    3636      {"ProgramRootSymbol", "Prog"},
    37       {"StartSymbol","RPB"}
     37      {"StartSymbol","RPB"},
     38      {"Multiplication", "$\\times$"},
     39      {"Division", "$\\div$"},
     40      {"Addition", "$+$"},
     41      {"Subtraction", "$-$"},
     42      {"Exponential", "$\\exp$"},
     43      {"Logarithm", "$\\log$"}
    3844    };
    3945
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeTile.cs

    r10650 r10655  
    2828
    2929namespace 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>
    3034  public class SymbolicExpressionTreeTile : Group {
    3135    public double PreferredNodeWidth { get; set; }
     
    3640      set {
    3741        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;
    3856        GeneratePrimitives(PreferredNodeWidth, PreferredNodeHeight);
    3957      }
    4058    }
    41 
    4259    public ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> LayoutEngine { get; set; }
    4360    private Dictionary<IPrimitive, ISymbolicExpressionTreeNode> primitiveMap;
     
    5572    private void GeneratePrimitives(double preferredNodeWidth, double preferredNodeHeight) {
    5673      Clear();
    57       ISymbolicExpressionTreeNode root = SymbolicExpressionTree.Root;
     74      ISymbolicExpressionTreeNode root = Root;
    5875      if (root.Symbol is ProgramRootSymbol && root.SubtreeCount == 1) { root = root.GetSubtree(0); }
    5976      var visualNodes = LayoutEngine.CalculateLayout(root);
     
    7491        }
    7592
     93        primitiveMap.Add(rectangularPrimitive, node); // to be able to retrieve nodes via primitives
    7694        this.Add(rectangularPrimitive);
    7795      }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.Views-3.4.csproj

    r10650 r10655  
    193193  <ItemGroup>
    194194    <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>
    195201    <Compile Include="InteractiveSymbolicExpressionTreeChart.cs">
    196202      <SubType>UserControl</SubType>
     
    231237      <DependentUpon>SymbolicDataAnalysisExpressionGenealogyGraphChart.cs</DependentUpon>
    232238    </Compile>
    233     <Compile Include="SymbolicDataAnalysisExpressionLineageExplorerChart.cs">
    234       <SubType>UserControl</SubType>
    235     </Compile>
    236     <Compile Include="SymbolicDataAnalysisExpressionLineageExplorerChart.Designer.cs">
    237       <DependentUpon>SymbolicDataAnalysisExpressionLineageExplorerChart.cs</DependentUpon>
     239    <Compile Include="SymbolicExpressionChartControl.cs">
     240      <SubType>UserControl</SubType>
     241    </Compile>
     242    <Compile Include="SymbolicExpressionChartControl.Designer.cs">
     243      <DependentUpon>SymbolicExpressionChartControl.cs</DependentUpon>
    238244    </Compile>
    239245    <Compile Include="SymbolicDataAnalysisExpressionLineageExplorerView.cs">
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymboldDataAnalysisGenealogyView.cs

    r10654 r10655  
    9898        var fragmentGraph = TraceSubtree(subtree);
    9999
    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
    112101      } else {
    113102        // perform matching like it was done before
     
    186175      var fragmentLength = fragment.Root.GetLength();
    187176
     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)
    188183      if (fragment.Index == index) {
    189184        // the selected subtree is the actual fragment
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisExpressionLineageExplorerView.Designer.cs

    r10517 r10655  
    2525    private void InitializeComponent() {
    2626      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();
    2828      this.SuspendLayout();
    2929      //
    3030      // treeView
    3131      //
    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)
    3333            | System.Windows.Forms.AnchorStyles.Left)));
    3434      this.treeView.Location = new System.Drawing.Point(3, 3);
     
    3838      this.treeView.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView_AfterSelect);
    3939      //
    40       // lineageExplorerChart
     40      // symbolicExpressionChartControl
    4141      //
    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)
    4444            | 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;
    5454      //
    5555      // SymbolicDataAnalysisExpressionLineageExplorerView
     
    5757      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    5858      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
    59       this.Controls.Add(this.lineageExplorerChart);
     59      this.Controls.Add(this.symbolicExpressionChartControl);
    6060      this.Controls.Add(this.treeView);
    6161      this.DoubleBuffered = true;
     
    7070
    7171    private System.Windows.Forms.TreeView treeView;
    72     private SymbolicDataAnalysisExpressionLineageExplorerChart lineageExplorerChart;
     72    private SymbolicExpressionChartControl symbolicExpressionChartControl;
    7373  }
    7474}
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/SymbolicDataAnalysisExpressionLineageExplorerView.cs

    r10650 r10655  
    3838
    3939      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);
    4444      }
    4545    }
     
    6060      var lastGen = Content.Ranks.OrderBy(x => x.Key).Last().Value.ToList();
    6161      treeMap.Clear();
    62       lineageExplorerChart.Clear();
     62      symbolicExpressionChartControl.Clear();
    6363      foreach (var g in lastGen) {
    6464        var treeNode = new TreeNode(g.Quality.ToString(CultureInfo.InvariantCulture));
     
    6969
    7070    private void treeView_AfterSelect(object sender, TreeViewEventArgs e) {
    71       lineageExplorerChart.Clear();
     71      symbolicExpressionChartControl.Clear();
    7272      var selectedNode = treeView.SelectedNode;
    7373      var symbolicExpressionTree = treeMap[selectedNode];
    74       var chart = lineageExplorerChart.Chart;
     74      var chart = symbolicExpressionChartControl.Chart;
    7575      var tile = new SymbolicExpressionTreeTile(chart) {
    7676        LayoutEngine = symbolicExpressionTreeNodeLayoutEngine,
     
    7979        SymbolicExpressionTree = symbolicExpressionTree
    8080      };
    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();
    8686    }
    8787  }
Note: See TracChangeset for help on using the changeset viewer.