- Timestamp:
- 02/05/15 19:35:34 (9 years ago)
- Location:
- branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraph.cs
r11852 r11925 37 37 private Dictionary<string, IGenealogyGraphNode> idMap; 38 38 39 private readonly Comparison<IArc > compareArcs = (a, b) => {39 private readonly Comparison<IArc<IDeepCloneable>> compareArcs = (a, b) => { 40 40 if (a.Data == b.Data) 41 41 return 0; … … 56 56 RebuildDictionaries(); 57 57 58 foreach (var arcs in Vertices.Select(v => (List<IArc>)((IVertex)v).InArcs)) { arcs.Sort(compareArcs); }58 foreach (var arcs in Vertices.Select(v => v.InArcs.ToList())) { arcs.Sort(compareArcs); } 59 59 } 60 60 public override IDeepCloneable Clone(Cloner cloner) { … … 69 69 private void AfterDeserialization() { 70 70 RebuildDictionaries(); 71 foreach (var arcs in Vertices.Select(v => (List<IArc>)((Vertex)v).InArcs)) { arcs.Sort(compareArcs); }71 foreach (var arcs in Vertices.Select(v => v.InArcs.ToList())) { arcs.Sort(compareArcs); } 72 72 } 73 73 public GenealogyGraph() { … … 169 169 return ColorGradient.Colors[colorIndex]; 170 170 } 171 172 public override void AddVertices(IEnumerable<IVertex> vertexList) {173 base.AddVertices(vertexList);174 RebuildDictionaries();175 }176 171 } 177 172 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphArc.cs
r11502 r11925 27 27 [StorableClass] 28 28 [Item("GenealogyGraphArc", "A graph arc connecting two GenealogyGraphNodes and holding some data.")] 29 public class GenealogyGraphArc : Arc , IGenealogyGraphArc {29 public class GenealogyGraphArc : Arc<IDeepCloneable>, IGenealogyGraphArc { 30 30 [StorableConstructor] 31 31 protected GenealogyGraphArc(bool deserializing) : base(deserializing) { } … … 55 55 [StorableConstructor] 56 56 protected GenealogyGraphArc(bool deserializing) : base(deserializing) { } 57 57 58 protected GenealogyGraphArc(GenealogyGraphArc original, Cloner cloner) 58 59 : base(original, cloner) { … … 62 63 return new GenealogyGraphArc<T>(this, cloner); 63 64 } 65 64 66 public new T Data { 65 67 get { return (T)base.Data; } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphNode.cs
r11858 r11925 30 30 [StorableClass] 31 31 [Item("GenealogGraphNode", "A class representing a node in the GenealogyGraph")] 32 public class GenealogyGraphNode : Vertex , IGenealogyGraphNode {32 public class GenealogyGraphNode : Vertex<IDeepCloneable>, IGenealogyGraphNode { 33 33 [StorableConstructor] 34 34 protected GenealogyGraphNode(bool deserializing) : base(deserializing) { } … … 46 46 } 47 47 48 public GenealogyGraphNode() { 49 Id = Guid.NewGuid().ToString(); 50 } 51 48 52 public GenealogyGraphNode(IDeepCloneable data) 49 : base(data) {50 Id = Guid.NewGuid().ToString();53 : this() { 54 Data = data; 51 55 } 52 56 -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphArc.cs
r11253 r11925 20 20 #endregion 21 21 22 using HeuristicLab.Common; 22 23 using HeuristicLab.Core; 23 24 24 25 namespace HeuristicLab.EvolutionTracking { 25 public interface IGenealogyGraphArc : IArc {26 public interface IGenealogyGraphArc : IArc<IDeepCloneable> { 26 27 new IGenealogyGraphNode Source { get; } 27 28 new IGenealogyGraphNode Target { get; } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphNode.cs
r11253 r11925 22 22 using System; 23 23 using System.Collections.Generic; 24 using HeuristicLab.Common; 24 25 using HeuristicLab.Core; 25 26 26 27 namespace HeuristicLab.EvolutionTracking { 27 public interface IGenealogyGraphNode : IVertex , IComparable<IGenealogyGraphNode> {28 public interface IGenealogyGraphNode : IVertex<IDeepCloneable>, IComparable<IGenealogyGraphNode> { 28 29 double Rank { get; set; } 29 30 double Quality { get; set; } … … 39 40 } 40 41 41 public interface IGenealogyGraphNode<T> : IGenealogyGraphNode , IVertex<T>where T : class {42 public interface IGenealogyGraphNode<T> : IGenealogyGraphNode where T : class { 42 43 new IEnumerable<IGenealogyGraphNode<T>> Parents { get; } 43 44 new IEnumerable<IGenealogyGraphNode<T>> Children { get; } 44 45 45 new IEnumerable<IGenealogyGraphNode<T>> Ancestors { get; } 46 46 new IEnumerable<IGenealogyGraphNode<T>> Descendants { get; } 47 48 new T Data { get; set; } 47 49 } 48 50 } -
branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/HeuristicLab.EvolutionTracking-3.4.csproj
r11639 r11925 110 110 <ItemGroup> 111 111 <Compile Include="Analyzers\GenealogyAnalyzer.cs" /> 112 <Compile Include="Collections\CloneableCollection.cs" /> 112 113 <Compile Include="Fragment.cs" /> 113 114 <Compile Include="Interfaces\IFragment.cs" />
Note: See TracChangeset
for help on using the changeset viewer.