Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/24/14 16:59:22 (10 years ago)
Author:
bburlacu
Message:

#1772: Added new SymbolicDataAnalysisGenealogyView and added support for the tracing of building blocks (finding the constituent ancestral elements of a selected subtree).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Views/3.4/SymbolicExpressionTreeTile.cs

    r10524 r10650  
    4141
    4242    public ReingoldTilfordLayoutEngine<ISymbolicExpressionTreeNode> LayoutEngine { get; set; }
    43     public SymbolicExpressionTreeTile(IChart chart) : base(chart) { }
     43    private Dictionary<IPrimitive, ISymbolicExpressionTreeNode> primitiveMap;
     44
     45    public SymbolicExpressionTreeTile(IChart chart)
     46      : base(chart) {
     47      primitiveMap = new Dictionary<IPrimitive, ISymbolicExpressionTreeNode>();
     48    }
    4449    public SymbolicExpressionTreeTile(IChart chart, ISymbolicExpressionTree tree)
    45       : base(chart) {
     50      : this(chart) {
    4651      SymbolicExpressionTree = tree;
    4752      PreferredNodeWidth = 80;
     
    5055    private void GeneratePrimitives(double preferredNodeWidth, double preferredNodeHeight) {
    5156      Clear();
    52       LayoutEngine.Initialize(SymbolicExpressionTree.Root, node => node.Subtrees);
    53       LayoutEngine.CalculateLayout();
     57      ISymbolicExpressionTreeNode root = SymbolicExpressionTree.Root;
     58      if (root.Symbol is ProgramRootSymbol && root.SubtreeCount == 1) { root = root.GetSubtree(0); }
     59      var visualNodes = LayoutEngine.CalculateLayout(root);
    5460
    55       var primitivesMap = new Dictionary<ISymbolicExpressionTreeNode, IPrimitive>(); // both Ellipse and Rectangle are derived from the RectangularPrimitiveBase
    5661      var font = new Font(FontFamily.GenericSansSerif, 10, GraphicsUnit.Pixel);
    5762
    58       var visualNodes = LayoutEngine.GetVisualNodes().ToList();
    5963      var visualNodeMap = visualNodes.ToDictionary(x => x.Content, x => x);
    6064
     
    7175
    7276        this.Add(rectangularPrimitive);
    73         primitivesMap.Add(node, rectangularPrimitive);
    7477      }
    7578
Note: See TracChangeset for help on using the changeset viewer.