Ignore:
Timestamp:
02/19/14 22:18:49 (6 years ago)
Author:
bburlacu
Message:

#2076: Thanks for the feedback:

  • I removed the ILayoutNode Interfaces
  • Fixed the error that was causing it to crash in the textual representation
  • The ancestor is a node on the path between the root and the current node (from the paper), but in the algorithm it's assigned differently
  • Parent is the immediate parent

I also increased the node label text size a bit and did some cosmetic improvements.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.ReingoldTilfordTreeLayout/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/LayoutEngines/LayoutNode.cs

    r9970 r10471  
    2020#endregion
    2121
     22using System;
    2223using System.Collections.Generic;
    2324using System.Linq;
    2425
    25 namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.LayoutEngines {
    26   public class LayoutNode<T> : ILayoutNode<T> where T : class {
    27     public ILayoutNode<T> NextLeft {
     26namespace HeuristicLab.Encodings.SymbolicExpressionTreeEncoding {
     27  public class LayoutNode<T> where T : class {
     28    public LayoutNode<T> NextLeft {
    2829      get {
    2930        return Children == null ? Thread : Children.First();
    3031      }
    3132    }
    32     public ILayoutNode<T> NextRight {
     33    public LayoutNode<T> NextRight {
    3334      get {
    3435        return Children == null ? Thread : Children.Last();
    3536      }
    3637    }
    37     public ILayoutNode<T> LeftSibling {
     38    public LayoutNode<T> LeftSibling {
    3839      get {
    3940        if (Parent == null) return null;
     
    4142      }
    4243    }
    43     public ILayoutNode<T> LeftmostSibling {
     44    public LayoutNode<T> LeftmostSibling {
    4445      get {
    4546        if (Parent == null) return null;
     
    4849    }
    4950
    50     public ILayoutNode<T> Thread { get; set; }
    51     public ILayoutNode<T> Ancestor { get; set; }
    52     public ILayoutNode<T> Parent { get; set; }
    53     public List<ILayoutNode<T>> Children { get; set; }
     51    public LayoutNode<T> Thread { get; set; }
     52    public LayoutNode<T> Ancestor { get; set; }
     53    public LayoutNode<T> Parent { get; set; }
     54    public List<LayoutNode<T>> Children { get; set; }
    5455    public float Mod { get; set; }
    5556    public float Prelim { get; set; }
     
    6566    }
    6667
    67     public T Content { get; set; }
     68    private T content;
     69    public T Content {
     70      get { return content; }
     71      set {
     72        if (value == null)
     73          throw new ArgumentNullException("LayoutNode: Content cannot be null.");
     74        content = value;
     75      }
     76    }
    6877  }
    6978}
Note: See TracChangeset for help on using the changeset viewer.