Changeset 11303 for branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core/3.3/Collections/DirectedGraph/Vertex.cs
- Timestamp:
- 08/26/14 13:05:22 (10 years ago)
- Location:
- branches/HeuristicLab.Problems.Orienteering
- Files:
-
- 2 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.Orienteering
- Property svn:mergeinfo changed
/trunk/sources merged: 11214,11241,11248-11251,11256,11263,11274,11280,11282-11283,11290,11292,11294-11296,11298,11300,11302
- Property svn:mergeinfo changed
-
branches/HeuristicLab.Problems.Orienteering/HeuristicLab.Core/3.3/Collections/DirectedGraph/Vertex.cs
r11241 r11303 27 27 28 28 namespace HeuristicLab.Core { 29 [Item("Vertex", "An object representing a vertex in the graph. It can have a text label, a weight, and an additional data object.")] 29 30 [StorableClass] 30 31 public class Vertex : Item, IVertex { … … 92 93 weight = original.Weight; 93 94 94 inArcs = original.InArcs.Select(cloner.Clone).ToList(); 95 outArcs = original.OutArcs.Select(cloner.Clone).ToList(); 95 // we do not clone the arcs here (would cause too much recursion and ultimately a stack overflow) 96 96 } 97 97 … … 102 102 public void AddArc(IArc arc) { 103 103 if (this != arc.Source && this != arc.Target) 104 throw new InvalidOperationException("The current vertex must be either the arc source or the arc target."); 104 throw new ArgumentException("The current vertex must be either the arc source or the arc target."); 105 106 if (arc.Source == arc.Target) 107 throw new ArgumentException("Arc source and target must be different."); 105 108 106 109 if (this == arc.Source) { … … 117 120 public void RemoveArc(IArc arc) { 118 121 if (this != arc.Source && this != arc.Target) 119 throw new InvalidOperationException("The current vertex must be either the arc source or the arc target.");122 throw new ArgumentException("The current vertex must be either the arc source or the arc target."); 120 123 121 124 if (this == arc.Source) { … … 167 170 } 168 171 172 public Vertex(IDeepCloneable data) 173 : base(data) { 174 } 175 169 176 public override IDeepCloneable Clone(Cloner cloner) { 170 177 return new Vertex<T>(this, cloner);
Note: See TracChangeset
for help on using the changeset viewer.