Exemplo n.º 1
0
        public void RemoveArc(PathNode node1, PathNode node2)
        {
            PathArc arc = GetArc(node1, node2);

            node1.Arcs.Remove(arc);
            node2.Arcs.Remove(arc);
        }
Exemplo n.º 2
0
 public PathArc GetArc(PathNode node1, PathNode node2)
 {
     for (int i = 0; i < node1.Arcs.Count; i++)
     {
         PathArc arc = node1.Arcs[i];
         if (arc.Node1 == node2 || arc.Node2 == node2)
         {
             return(arc);
         }
     }
     return(INVALID_ARC);
 }
Exemplo n.º 3
0
        public void AddArc(PathNode node1, PathNode node2)
        {
            PathArc arc = new PathArc(node1, node2, _mobilityTypes.Count);

            node1.Arcs.Add(arc);
            node2.Arcs.Add(arc);

            // Compute the arc's traversal time for each MobilityType
            foreach (MobilityData mobility in _mobilityTypes)
            {
                arc.Time[mobility.Index] = Pathfinder.FindLocalPath(this,
                                                                    Position(node1),
                                                                    Position(node2),
                                                                    mobility,
                                                                    0f);
            }
        }