Ejemplo n.º 1
0
 public void AddEdge(GraphVertex target, double distance)
 {
     if (target == null)
     {
         throw new ArgumentNullException("target");
     }
     if (target == this)
     {
         throw new ArgumentException("Current implementation neither expects nor allows Vertices to connect to themselves.");
     }
     if (distance < 0)
     {
         throw new ArgumentException("Distance must be positive.");
     }
     _edges.Add(new GraphEdge(target, distance));
 }
Ejemplo n.º 2
0
        public void AddVertex(Vector2 v)
        {
            var vertex = new GraphVertex(v);

            Vertices.Add(v, vertex);
        }
Ejemplo n.º 3
0
 public GraphEdge(GraphVertex terminator, double weight)
 {
     _weight     = weight;
     _terminator = terminator;
 }