public class ThetaStar extends GridAStar
| Constructor and Description |
|---|
ThetaStar() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
computeBestPath(java.util.List<java.util.List<GridNode>> searchArea,
GridNode node,
GridNode neighbor)
Determines whether to set a neighbor's parent to the node or to the node's parent.
|
protected int |
distanceBetweenNodes(GridNode a,
GridNode b)
Returns the approximate distance between two nodes in the search area.
|
java.util.List<GridNode> |
findPath(java.util.List<java.util.List<GridNode>> searchArea,
GridNode start,
GridNode dest)
Returns a List representing the path between two nodes in a two-dimensional search space.
|
java.util.List<java.util.List<java.lang.String>> |
getVisibilityGraph(java.util.List<java.util.List<GridNode>> searchArea,
GridNode node)
Checks if every node in the search area is within line of sight with the given node.
|
void |
printAllLOSNodeCombinations(java.util.List<java.util.List<GridNode>> searchArea)
Calculates the line of sight for every node to every other node and prints
out the results.
|
computeBestPath, getManhattanDistance, printPath, printSearchArea, reconstructPathpublic java.util.List<GridNode> findPath(java.util.List<java.util.List<GridNode>> searchArea, GridNode start, GridNode dest)
findPath in interface Pathfinder<GridNode,java.util.List<java.util.List<GridNode>>>findPath in class GridAStarsearchArea - a 2D list holding all of the GridNodes that describe the spacestart - the start node for the path search and must inherit from Nodedest - the destination node for the path search and must inherit from Nodeprotected void computeBestPath(java.util.List<java.util.List<GridNode>> searchArea, GridNode node, GridNode neighbor)
searchArea - a 2D list holding all of the GridNodes that describe the spacenode - the current node being visited in the path searchneighbor - a neighbor of nodeprotected int distanceBetweenNodes(GridNode a, GridNode b)
distanceBetweenNodes in class GridAStara - first nodeb - second nodepublic void printAllLOSNodeCombinations(java.util.List<java.util.List<GridNode>> searchArea)
searchArea - a 2D list holding all of the GridNodes that describe the spacepublic java.util.List<java.util.List<java.lang.String>> getVisibilityGraph(java.util.List<java.util.List<GridNode>> searchArea, GridNode node)
searchArea - a 2D list holding all of the GridNodes that describe the spacenode - the node used to