Beispiel #1
0
        /// <summary>
        /// Generate the actual path for the robot
        /// </summary>
        /// <returns>returns the actual path</returns>
        private List <Node> GeneratePath()
        {
            bool        done            = false;
            List <Node> path            = new List <Node>();
            Road        DestinationRoad = GetRoadByNode(Destination);

            while (!done)
            {
                if (DestinationRoad != null)
                {
                    path.Insert(0, DestinationRoad.Node);
                    DestinationRoad = DestinationRoad.PreviousNode;
                }
                else
                {
                    done = true;
                }
            }

            return(path);
        }
Beispiel #2
0
 /// <summary>
 /// Update the previous road
 /// </summary>
 /// <param name="road"></param>
 public void AddPreviousRoad(Road road)
 {
     PreviousNode = road;
 }