Exemplo n.º 1
0
        /// <summary>
        /// Resets the AStar algorithm with the newly specified start node and goal node.
        /// </summary>
        /// <param name="start">The starting node for the AStar algorithm.</param>
        /// <param name="goal">The goal node for the AStar algorithm.</param>
        private void Reset(IGraphNode start, IGraphNode goal)
        {
            _openList.Clear();
            _closedList.Clear();
            _dataDict.Clear();

            CurrentNode = start;
            _goal       = goal;

            var currentData = GetData(CurrentNode);

            _openList.AddWithData(CurrentNode, currentData);
        }