Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.EvolutionaryTracking/3.4/GenericGraph/Arc.cs @ 9419

Last change on this file since 9419 was 9419, checked in by bburlacu, 11 years ago

#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.

File size: 1.4 KB
Line 
1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
4
5namespace HeuristicLab.EvolutionaryTracking {
6  /// <summary>
7  /// An arc that can have a weight, a label, and can old additional information in the Data object
8  /// </summary>
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    }
41  }
42}
Note: See TracBrowser for help on using the repository browser.