Changeset 10886 for branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph
- Timestamp:
- 05/22/14 13:49:35 (10 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs
r10833 r10886 40 40 get { return from n in base.Nodes select (IGenealogyGraphNode)n; } 41 41 } 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 42 50 protected GenealogyGraph(GenealogyGraph original, Cloner cloner) 43 51 : base(original, cloner) { … … 98 106 get { return from n in base.Nodes select (IGenealogyGraphNode<T>)n; } 99 107 } 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 100 116 // contructors 101 117 protected GenealogyGraph(GenealogyGraph<T> original, Cloner cloner) -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphArc.cs
r10293 r10886 32 32 protected GenealogyGraphArc(GenealogyGraphArc original, Cloner cloner) 33 33 : base(original, cloner) { 34 this.Target = original.Target; 35 this.Source = original.Source; 36 this.Label = original.Label; 37 this.Weight = original.Weight; 38 this.Data = original.Data; 34 39 } 35 40 36 public GenealogyGraphArc() { } 41 protected GenealogyGraphArc() { } 42 43 public GenealogyGraphArc(IGenealogyGraphNode source, IGenealogyGraphNode target, object data = null) { 44 Source = source; 45 Target = target; 46 Data = data; 47 } 37 48 38 49 public override IDeepCloneable Clone(Cloner cloner) { … … 60 71 Data = (T)original.Data.Clone(); 61 72 } 62 public GenealogyGraphArc() { }63 73 64 74 public override IDeepCloneable Clone(Cloner cloner) { -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphNode.cs
r10685 r10886 107 107 return Quality.CompareTo(other.Quality); 108 108 } 109 public new void AddForwardArc(IVertex target, double w = 0.0, object data = null) {110 var arc = new GenealogyGraphArc { Source = this, Target = (IGenealogyGraphNode)target, Data = data, Weight = w };111 base.AddForwardArc(arc);112 }113 public new void AddReverseArc(IVertex source, double w = 0.0, object data = null) {114 var arc = new GenealogyGraphArc { Source = (IGenealogyGraphNode)source, Target = this, Data = data, Weight = w };115 base.AddReverseArc(arc);116 }117 109 public IEnumerable<IGenealogyGraphNode> Parents { 118 110 get { return InArcs.Select(a => a.Source); } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraph.cs
r10830 r10886 27 27 Dictionary<double, List<IGenealogyGraphNode>> Ranks { get; } 28 28 new IEnumerable<IGenealogyGraphNode> Nodes { get; } 29 IGenealogyGraphArc AddArc(IGenealogyGraphNode source, IGenealogyGraphNode target); 29 30 } 30 31
Note: See TracChangeset
for help on using the changeset viewer.