Rebornbuddy
|
Class to search the best path between two nodes on a graph. More...
Public Member Functions | |
AStarz (Graph G) | |
AStar Constructor. | |
bool | SearchPath (Node StartNode, Node EndNode) |
Searches for the best path to reach the specified EndNode from the specified StartNode. | |
void | Initialize (Node StartNode, Node EndNode) |
Use for a 'step by step' search only. This method is alternate to SearchPath. Initializes AStar before performing search steps manually with NextStep. | |
bool | NextStep () |
Use for a 'step by step' search only. This method is alternate to SearchPath. The algorithm must have been initialize before. | |
bool | ResultInformation (out int NbArcsOfPath, out double CostOfPath) |
Returns information on the result. |
Public Attributes | |
Graph | _Graph |
Properties | |
static Heuristic | EuclidianHeuristic [get] |
Heuristic based on the euclidian distance : Sqrt(Dx�+Dy�+Dz�) | |
static Heuristic | MaxAlongAxisHeuristic [get] |
Heuristic based on the maximum distance : Max(|Dx|, |Dy|, |Dz|) | |
static Heuristic | ManhattanHeuristic [get] |
Heuristic based on the manhattan distance : |Dx|+|Dy|+|Dz|. | |
Heuristic | ChoosenHeuristic [get, set] |
Gets/Sets the heuristic that AStar will use. It must be homogeneous to arc's cost. | |
float | DijkstraHeuristicBalance [set] |
This value must belong to [0; 1] and it determines the influence of the heuristic on the algorithm. If this influence value is set to 0, then the search will behave in accordance with the Dijkstra algorithm. If this value is set to 1, then the cost to come to the current node will not be used whereas only the heuristic will be taken into account. | |
Node[][] | Open [get] |
Use for debug in 'step by step' mode only. Returns all the tracks found in the 'Open' list of the algorithm at a given time. A track is a list of the nodes visited to come to the current node. | |
Node[][] | Closed [get] |
Use for debug in a 'step by step' mode only. Returns all the tracks found in the 'Closed' list of the algorithm at a given time. A track is a list of the nodes visited to come to the current node. | |
bool | Initialized [get] |
To know if the search has been initialized. | |
bool | SearchStarted [get] |
To know if the search has been started. | |
bool | SearchEnded [get] |
To know if the search has ended. | |
bool | PathFound [get] |
To know if a path has been found. | |
int | StepCounter [get] |
Use for a 'step by step' search only. Gets the number of the current step. -1 if the search has not been initialized. 0 if it has not been started. | |
Node[] | PathByNodes [get] |
Gets the array of nodes representing the found path. | |
Vector3[] | PathByCoordinates [get] |
Gets the array of arcs representing the found path. |
Class to search the best path between two nodes on a graph.
Pathfinding.AStarz.AStarz | ( | Graph | G | ) |
Use for a 'step by step' search only. This method is alternate to SearchPath. Initializes AStar before performing search steps manually with NextStep.
ArgumentNullException | StartNode and EndNode cannot be null. |
StartNode | The node from which the path must start. |
EndNode | The node to which the path must end. |
bool Pathfinding.AStarz.NextStep | ( | ) |
Use for a 'step by step' search only. This method is alternate to SearchPath. The algorithm must have been initialize before.
InvalidOperationException | You must initialize AStar before using NextStep(). |
bool Pathfinding.AStarz.ResultInformation | ( | out int | NbArcsOfPath, |
out double | CostOfPath ) |
Returns information on the result.
NbArcsOfPath | The number of arcs in the result path / -1 if no result. |
CostOfPath | The cost of the result path / -1 if no result. |
Searches for the best path to reach the specified EndNode from the specified StartNode.
ArgumentNullException | StartNode and EndNode cannot be null. |
StartNode | The node from which the path must start. |
EndNode | The node to which the path must end. |
Graph Pathfinding.AStarz._Graph |
|
getset |
Gets/Sets the heuristic that AStar will use. It must be homogeneous to arc's cost.
|
get |
Use for debug in a 'step by step' mode only. Returns all the tracks found in the 'Closed' list of the algorithm at a given time. A track is a list of the nodes visited to come to the current node.
|
set |
This value must belong to [0; 1] and it determines the influence of the heuristic on the algorithm. If this influence value is set to 0, then the search will behave in accordance with the Dijkstra algorithm. If this value is set to 1, then the cost to come to the current node will not be used whereas only the heuristic will be taken into account.
ArgumentException | Value must belong to [0;1]. |
|
staticget |
Heuristic based on the euclidian distance : Sqrt(Dx�+Dy�+Dz�)
|
get |
To know if the search has been initialized.
|
staticget |
Heuristic based on the manhattan distance : |Dx|+|Dy|+|Dz|.
|
staticget |
Heuristic based on the maximum distance : Max(|Dx|, |Dy|, |Dz|)
|
get |
Use for debug in 'step by step' mode only. Returns all the tracks found in the 'Open' list of the algorithm at a given time. A track is a list of the nodes visited to come to the current node.
|
get |
Gets the array of arcs representing the found path.
InvalidOperationException | You cannot get a result unless the search has ended. |
Gets the array of points representing the found path.
InvalidOperationException | You cannot get a result unless the search has ended. |
|
get |
Gets the array of nodes representing the found path.
InvalidOperationException | You cannot get a result unless the search has ended. |
|
get |
To know if a path has been found.
|
get |
To know if the search has ended.
|
get |
To know if the search has been started.
|
get |
Use for a 'step by step' search only. Gets the number of the current step. -1 if the search has not been initialized. 0 if it has not been started.