Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/05/15 19:35:34 (9 years ago)
Author:
bburlacu
Message:

#1772:

  • Removed unused code
  • Adapted genealogy graph according to the trunk changes to the directed graph
  • Adapted trace calculator and before/after operators
  • Introduced a CloneableCollection to help save node lists
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  
    3737    private Dictionary<string, IGenealogyGraphNode> idMap;
    3838
    39     private readonly Comparison<IArc> compareArcs = (a, b) => {
     39    private readonly Comparison<IArc<IDeepCloneable>> compareArcs = (a, b) => {
    4040      if (a.Data == b.Data)
    4141        return 0;
     
    5656      RebuildDictionaries();
    5757
    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); }
    5959    }
    6060    public override IDeepCloneable Clone(Cloner cloner) {
     
    6969    private void AfterDeserialization() {
    7070      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); }
    7272    }
    7373    public GenealogyGraph() {
     
    169169      return ColorGradient.Colors[colorIndex];
    170170    }
    171 
    172     public override void AddVertices(IEnumerable<IVertex> vertexList) {
    173       base.AddVertices(vertexList);
    174       RebuildDictionaries();
    175     }
    176171  }
    177172
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphArc.cs

    r11502 r11925  
    2727  [StorableClass]
    2828  [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 {
    3030    [StorableConstructor]
    3131    protected GenealogyGraphArc(bool deserializing) : base(deserializing) { }
     
    5555    [StorableConstructor]
    5656    protected GenealogyGraphArc(bool deserializing) : base(deserializing) { }
     57
    5758    protected GenealogyGraphArc(GenealogyGraphArc original, Cloner cloner)
    5859      : base(original, cloner) {
     
    6263      return new GenealogyGraphArc<T>(this, cloner);
    6364    }
     65
    6466    public new T Data {
    6567      get { return (T)base.Data; }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/GenealogyGraphNode.cs

    r11858 r11925  
    3030  [StorableClass]
    3131  [Item("GenealogGraphNode", "A class representing a node in the GenealogyGraph")]
    32   public class GenealogyGraphNode : Vertex, IGenealogyGraphNode {
     32  public class GenealogyGraphNode : Vertex<IDeepCloneable>, IGenealogyGraphNode {
    3333    [StorableConstructor]
    3434    protected GenealogyGraphNode(bool deserializing) : base(deserializing) { }
     
    4646    }
    4747
     48    public GenealogyGraphNode() {
     49      Id = Guid.NewGuid().ToString();
     50    }
     51
    4852    public GenealogyGraphNode(IDeepCloneable data)
    49       : base(data) {
    50       Id = Guid.NewGuid().ToString();
     53      : this() {
     54      Data = data;
    5155    }
    5256
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphArc.cs

    r11253 r11925  
    2020#endregion
    2121
     22using HeuristicLab.Common;
    2223using HeuristicLab.Core;
    2324
    2425namespace HeuristicLab.EvolutionTracking {
    25   public interface IGenealogyGraphArc : IArc {
     26  public interface IGenealogyGraphArc : IArc<IDeepCloneable> {
    2627    new IGenealogyGraphNode Source { get; }
    2728    new IGenealogyGraphNode Target { get; }
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/GenealogyGraph/Interfaces/IGenealogyGraphNode.cs

    r11253 r11925  
    2222using System;
    2323using System.Collections.Generic;
     24using HeuristicLab.Common;
    2425using HeuristicLab.Core;
    2526
    2627namespace HeuristicLab.EvolutionTracking {
    27   public interface IGenealogyGraphNode : IVertex, IComparable<IGenealogyGraphNode> {
     28  public interface IGenealogyGraphNode : IVertex<IDeepCloneable>, IComparable<IGenealogyGraphNode> {
    2829    double Rank { get; set; }
    2930    double Quality { get; set; }
     
    3940  }
    4041
    41   public interface IGenealogyGraphNode<T> : IGenealogyGraphNode, IVertex<T> where T : class {
     42  public interface IGenealogyGraphNode<T> : IGenealogyGraphNode where T : class {
    4243    new IEnumerable<IGenealogyGraphNode<T>> Parents { get; }
    4344    new IEnumerable<IGenealogyGraphNode<T>> Children { get; }
    44 
    4545    new IEnumerable<IGenealogyGraphNode<T>> Ancestors { get; }
    4646    new IEnumerable<IGenealogyGraphNode<T>> Descendants { get; }
     47
     48    new T Data { get; set; }
    4749  }
    4850}
  • branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/HeuristicLab.EvolutionTracking-3.4.csproj

    r11639 r11925  
    110110  <ItemGroup>
    111111    <Compile Include="Analyzers\GenealogyAnalyzer.cs" />
     112    <Compile Include="Collections\CloneableCollection.cs" />
    112113    <Compile Include="Fragment.cs" />
    113114    <Compile Include="Interfaces\IFragment.cs" />
Note: See TracChangeset for help on using the changeset viewer.