Free cookie consent management tool by TermsFeed Policy Generator

source: branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Edge.cs @ 8438

Last change on this file since 8438 was 8438, checked in by spimming, 12 years ago

#1894 graph interface and implementation initial commit

File size: 838 bytes
Line 
1
2namespace HeuristicLab.Problems.RoutePlanning.Graph {
3  public class Edge<Vertex> : IEdge<Vertex> {
4    private readonly Vertex source;
5    public Vertex Source {
6      get { return this.source; }
7    }
8
9    private readonly Vertex target;
10    public Vertex Target {
11      get { return this.target; }
12    }
13
14    private short category;
15    public short Category {
16      get { return category; }
17      set { category = value; }
18    }
19
20    public Edge(Vertex source, Vertex target)
21      : this(source, target, 0) {
22
23    }
24
25    public Edge(Vertex source, Vertex target, short category) {
26      this.source = source;
27      this.target = target;
28      this.category = category;
29    }
30
31    public override string ToString() {
32      return string.Format("{0}->{1}", this.Source, this.Target);
33    }
34  }
35}
Note: See TracBrowser for help on using the repository browser.