public class NodeMap
extends java.lang.Object
| Constructor and Description |
|---|
NodeMap(double[][] nodeCostMap)
Initializes a new instance of the NodeMap class.
|
NodeMap(double[][] costMap,
AStar.Neighbor direction,
AStar.Heuristic heuristic)
Initializes a new instance of the NodeMap class.
|
NodeMap(int width,
int height,
double initialCost)
Initializes a new instance of the NodeMap class.
|
NodeMap(int width,
int height,
double initialCost,
AStar.Neighbor direction,
AStar.Heuristic heuristic)
Initializes a new instance of the NodeMap class.
|
| Modifier and Type | Method and Description |
|---|---|
NodeMap |
clone() |
double |
ComputeHeuristic(int startX,
int startY,
int endX,
int endY)
Compute the heuristic.
|
AStar.Neighbor |
getDirection()
Get direction.
|
int |
getHeight()
Get height of Node Map.
|
AStar.Heuristic |
getHeuristic()
Get heuristic.
|
ANode |
getNode(int x,
int y)
Get ANode from associate in this Node map.
|
ANode[] |
getSurroundingNodes(int x,
int y)
Get the neighbour nodes from the specified point.
|
int |
getWidth()
Get width of Node Map.
|
void |
setDirection(AStar.Neighbor direction)
Set direction.
|
void |
setHeuristic(AStar.Heuristic heuristic)
Set heuristic.
|
void |
setNode(int x,
int y,
ANode node)
Set ANode.
|
public ANode[][] nodes
public NodeMap(int width,
int height,
double initialCost)
width - Width.height - Height.initialCost - Initial cost to all nodes.public NodeMap(double[][] nodeCostMap)
nodeCostMap - Cost map.public NodeMap(int width,
int height,
double initialCost,
AStar.Neighbor direction,
AStar.Heuristic heuristic)
width - Width.height - Height.initialCost - Initial cost.direction - Direction.heuristic - Heuristic.public NodeMap(double[][] costMap,
AStar.Neighbor direction,
AStar.Heuristic heuristic)
costMap - Cost map.direction - Direction.heuristic - Heuristic.public int getWidth()
public int getHeight()
public ANode getNode(int x, int y)
x - X axis coordinate.y - Y axis coordinate.public void setNode(int x,
int y,
ANode node)
x - X axis coordinate.y - Y axis coordinate.node - ANode.public AStar.Neighbor getDirection()
public void setDirection(AStar.Neighbor direction)
direction - Direction.public AStar.Heuristic getHeuristic()
public void setHeuristic(AStar.Heuristic heuristic)
heuristic - Heuristic.public ANode[] getSurroundingNodes(int x, int y)
x - X axis coordinate.y - Y axis coordinate.public double ComputeHeuristic(int startX,
int startY,
int endX,
int endY)
startX - X axis coordinate.startY - Y axis coordinate.endX - X axis coordinate.endY - Y axis coordinate.public NodeMap clone()
clone in class java.lang.Object