Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/DirectedGraph/Arc.cs @ 10888

Last change on this file since 10888 was 10888, checked in by bburlacu, 10 years ago

#1772: Introduced separate class for FragmentNodes and adjusted tracing code. Fixed small bug creating the genealogy graph.

File size: 2.3 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using HeuristicLab.Common;
23using HeuristicLab.Core;
24using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
25
26namespace HeuristicLab.EvolutionTracking {
27  /// <summary>
28  /// An arc that can have a weight, a label, and can old additional information in the Data object
29  /// </summary>
30  [StorableClass]
31  public class Arc : Item, IArc {
32    [Storable]
33    private IVertex source;
34    public IVertex Source { get { return source; } set { source = value; } }
35    [Storable]
36    private IVertex target;
37    public IVertex Target { get { return target; } set { target = value; } }
38    [Storable]
39    private string label;
40    public string Label { get { return label; } set { label = value; } }
41    [Storable]
42    private double weight;
43    public double Weight { get { return weight; } set { weight = value; } }
44    [Storable]
45    private object data;
46    public object Data { get { return data; } set { data = value; } }
47
48    [StorableConstructor]
49    public Arc(bool deserializing) : base(deserializing) { }
50
51    public override IDeepCloneable Clone(Cloner cloner) {
52      return new Arc(this, cloner);
53    }
54    public Arc() { }
55
56    public Arc(IVertex source, IVertex target) {
57      Source = source;
58      Target = target;
59    }
60
61    protected Arc(Arc original, Cloner cloner)
62      : base(original, cloner) {
63      Source = original.Source;
64      Target = original.Target;
65      Label = original.Label;
66      Weight = original.Weight;
67      Data = original.Data;
68    }
69  }
70}
Note: See TracBrowser for help on using the repository browser.