- Timestamp:
- 08/04/14 14:58:47 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Core/3.3/Collections/DirectedGraph/Vertex.cs
r11248 r11263 93 93 weight = original.Weight; 94 94 95 inArcs = original.InArcs.Select(cloner.Clone).ToList(); 96 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) 97 96 } 98 97 … … 103 102 public void AddArc(IArc arc) { 104 103 if (this != arc.Source && this != arc.Target) 105 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."); 106 108 107 109 if (this == arc.Source) { … … 118 120 public void RemoveArc(IArc arc) { 119 121 if (this != arc.Source && this != arc.Target) 120 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."); 121 123 122 124 if (this == arc.Source) { … … 168 170 } 169 171 172 public Vertex(IDeepCloneable data) 173 : base(data) { 174 } 175 170 176 public override IDeepCloneable Clone(Cloner cloner) { 171 177 return new Vertex<T>(this, cloner);
Note: See TracChangeset
for help on using the changeset viewer.