Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/02/13 13:18:57 (11 years ago)
Author:
bburlacu
Message:

#1772: Refactoring of directed graph components, added code for correctly serializing vertices and edges. Added specific building blocks analyzers and new population diversity analyzer which correctly integrates with the parallel engine.

Location:
branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/GenericGraph
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/GenericGraph/Arc.cs

    r9082 r9419  
    1 
     1using HeuristicLab.Common;
     2using HeuristicLab.Core;
     3using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     4
    25namespace HeuristicLab.EvolutionaryTracking {
    36  /// <summary>
    47  /// An arc that can have a weight, a label, and can old additional information in the Data object
    58  /// </summary>
    6   public class Arc {
    7     public IVertex Source { get; set; }
    8     public IVertex Target { get; set; }
    9     public string Label { get; set; }
    10     public double Weight { get; set; }
    11     public object Data { get; set; }
     9  [StorableClass]
     10  public class Arc : Item, IEdge
     11  {
     12    [Storable] private IVertex source;
     13    public IVertex Source { get { return source; } set { source = value; } }
     14    [Storable] private IVertex target;
     15    public IVertex Target { get { return target; } set { target = value; } }
     16    [Storable] private string label;
     17    public string Label { get { return label; } set { label = value; } }
     18    [Storable] private double weight;
     19    public double Weight { get { return weight; } set { weight = value; } }
     20    [Storable] private object data;
     21    public object Data { get { return data; } set { data = value; } }
     22
     23    [StorableConstructor]
     24    public Arc(bool deserializing) : base(deserializing) {}
     25
     26    public Arc() {}
     27
     28    private Arc(Arc original, Cloner cloner) : base(original, cloner)
     29    {
     30      Source = original.Source;
     31      Target = original.Target;
     32      Label = original.Label;
     33      Weight = original.Weight;
     34      Data = original.Data;
     35    }
     36
     37    public override IDeepCloneable Clone(Cloner cloner)
     38    {
     39      return new Arc(this, cloner);
     40    }
    1241  }
    1342}
Note: See TracChangeset for help on using the changeset viewer.