| Modifier and Type | Class and Description |
|---|---|
static class |
AStar.Heuristic |
static class |
AStar.Neighbor |
| Constructor and Description |
|---|
AStar(double[][] costMap)
Initializes a new instance of the AStar class.
|
AStar(double[][] costMap,
AStar.Neighbor neighbor,
AStar.Heuristic heuristic)
Initializes a new instance of the AStar class.
|
AStar(int width,
int height)
Initializes a new instance of the AStar class.
|
AStar(int width,
int height,
double initialCost)
Initializes a new instance of the AStar class.
|
AStar(int width,
int height,
double initialCost,
AStar.Neighbor neighbor,
AStar.Heuristic heuristic)
Initializes a new instance of the AStar class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBlock(int x,
int y)
Add block in the path.
|
java.util.ArrayList<IntPoint> |
FindPath(int startX,
int startY,
int endX,
int endY)
Find path.
|
java.util.ArrayList<IntPoint> |
FindPath(IntPoint start,
IntPoint end)
Find path.
|
double |
getCost(int x,
int y)
Get cost from a point.
|
int |
getHeight()
Get height of the map.
|
AStar.Heuristic |
getHeuristic()
Get heuristic.
|
AStar.Neighbor |
getNeighbor()
Get neighbor size of the algorithm.
|
NodeMap |
getNodeMap()
Get node map.
|
double |
getTotalCost(java.util.ArrayList<IntPoint> path)
Get total cost.
|
int |
getWidth()
Get width of the map.
|
boolean |
isBlocked(int x,
int y)
Verify if the actual node is blocked.
|
void |
removeBlock(int x,
int y)
Remove block in the path.
|
void |
setCost(int x,
int y,
double cost)
Set cost.
|
void |
setHeuristic(AStar.Heuristic heuristic)
Set heuristic.
|
void |
setNeighbor(AStar.Neighbor neighbor)
Set neighbor size of the algorithm.
|
public AStar(int width,
int height)
width - Width of the Matrix.height - Height of the Matrix.public AStar(int width,
int height,
double initialCost)
width - Width of the Matrix.height - Height of the Matrix.initialCost - Initial cost for all nodes.public AStar(double[][] costMap)
costMap - Cost map.public AStar(double[][] costMap,
AStar.Neighbor neighbor,
AStar.Heuristic heuristic)
costMap - Cost map.neighbor - Neighbor.heuristic - Heuristic.public AStar(int width,
int height,
double initialCost,
AStar.Neighbor neighbor,
AStar.Heuristic heuristic)
width - Width of the matrix.height - Height of the matrix.initialCost - Initial cost for all the nodes.neighbor - Neighbor.heuristic - Heuristic.public int getWidth()
public int getHeight()
public AStar.Neighbor getNeighbor()
public void setNeighbor(AStar.Neighbor neighbor)
neighbor - Neighbor.public AStar.Heuristic getHeuristic()
public void setHeuristic(AStar.Heuristic heuristic)
heuristic - Heuristic.public void addBlock(int x,
int y)
x - X axis coordinate.y - Y axis coordinate.public void removeBlock(int x,
int y)
x - X axis coordinate.y - Y axis coordinate.public boolean isBlocked(int x,
int y)
x - X axis coordinate.y - Y axis coordinate.public double getCost(int x,
int y)
x - X axis coordinate.y - Y axis coordinate.public void setCost(int x,
int y,
double cost)
x - X axis coordinate.y - Y axis coordinate.cost - Cost.public NodeMap getNodeMap()
public double getTotalCost(java.util.ArrayList<IntPoint> path)
path - List of the points.public java.util.ArrayList<IntPoint> FindPath(IntPoint start, IntPoint end)
ISearch