Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/22/14 13:49:35 (10 years ago)
Author:
bburlacu
Message:

#1772: Simplified GenealogyGraph (and related components) API in an effort to improve speed and memory consumption (eg., by sharing the same arc when walking the graph in both directions: parent-child and child-parent).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs

    r10833 r10886  
    4040      get { return from n in base.Nodes select (IGenealogyGraphNode)n; }
    4141    }
     42
     43    public IGenealogyGraphArc AddArc(IGenealogyGraphNode source, IGenealogyGraphNode target) {
     44      var arc = new GenealogyGraphArc(source, target);
     45      source.AddForwardArc(arc);
     46      target.AddReverseArc(arc);
     47      return arc;
     48    }
     49
    4250    protected GenealogyGraph(GenealogyGraph original, Cloner cloner)
    4351      : base(original, cloner) {
     
    98106      get { return from n in base.Nodes select (IGenealogyGraphNode<T>)n; }
    99107    }
     108
     109    public IGenealogyGraphArc AddArc(IGenealogyGraphNode source, IGenealogyGraphNode target) {
     110      var arc = new GenealogyGraphArc(source, target);
     111      source.AddForwardArc(arc);
     112      target.AddReverseArc(arc);
     113      return arc;
     114    }
     115
    100116    // contructors
    101117    protected GenealogyGraph(GenealogyGraph<T> original, Cloner cloner)
Note: See TracChangeset for help on using the changeset viewer.