Catalano.Graph.Pathfinding.AStar
Class ANode
- java.lang.Object
-
- Catalano.Graph.Pathfinding.AStar.ANode
-
-
Constructor Summary
Constructors Constructor and Description ANode(int x, int y, double cost, NodeMap mapParent)Initializes a new instance of the ANode class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description ANodeclone(NodeMap parent)Clone this ANode.intcompareTo(ANode o)doubleComputeHeuristic(ANode Target)Compute heuristic in the specified ANode.doubleComputeHeuristic(int x, int y)Compute heuristic in the specified ANode.doublegetCost()Get cost.doublegetF()Get F value.doublegetG()Get G value.doublegetH()Get H value.NodeMapgetMapParent()Get Node map.ANodegetParent()Get parent.ANode[]getSurroundingNodes()Get Surrouding nodes.intgetX()Get X axis coordinate.intgetY()Set Y axis coordinate.booleanisOnClosedList()Check if is on closed list.booleanisOnOpenList()Check if is on open list.voidsetCost(double cost)Set cost.voidsetG(double g)Set G value.voidsetH(double h)Set H value.voidsetMapParent(NodeMap nodeMap)Set Node map.voidsetOnClosedList(boolean onClosedList)Set if this node is on closed list.voidsetOnOpenList(boolean onOpenList)Set if this node is on open list.voidsetParent(ANode node)Set parent.voidsetX(int x)Set X axis coordinate.voidsetY(int y)Set Y axis coordinate.
-
-
-
Constructor Detail
-
ANode
public ANode(int x, int y, double cost, NodeMap mapParent)Initializes a new instance of the ANode class.- Parameters:
x- X axis coordinate.y- Y axis coordinate.cost- Cost.mapParent- NodeMap.
-
-
Method Detail
-
getX
public int getX()
Get X axis coordinate.- Returns:
- X axis coordinate.
-
setX
public void setX(int x)
Set X axis coordinate.- Parameters:
x- X axis coordinate.
-
getY
public int getY()
Set Y axis coordinate.- Returns:
- Y axis coordinate.
-
setY
public void setY(int y)
Set Y axis coordinate.- Parameters:
y- Y axis coordinate.
-
getCost
public double getCost()
Get cost.- Returns:
- Cost.
-
setCost
public void setCost(double cost)
Set cost.- Parameters:
cost- Cost.
-
getH
public double getH()
Get H value.- Returns:
- H Value.
-
setH
public void setH(double h)
Set H value.- Parameters:
h- H value.
-
getG
public double getG()
Get G value.- Returns:
- G value.
-
setG
public void setG(double g)
Set G value.- Parameters:
g- G value.
-
getF
public double getF()
Get F value.- Returns:
- F value.
-
isOnOpenList
public boolean isOnOpenList()
Check if is on open list.- Returns:
- True if is on open list, otherwise false.
-
setOnOpenList
public void setOnOpenList(boolean onOpenList)
Set if this node is on open list.- Parameters:
onOpenList- True if this node is on open list.
-
isOnClosedList
public boolean isOnClosedList()
Check if is on closed list.- Returns:
- True if is on closed list, otherwise false.
-
setOnClosedList
public void setOnClosedList(boolean onClosedList)
Set if this node is on closed list.- Parameters:
onClosedList- True if this node is on closed list.
-
getParent
public ANode getParent()
Get parent.- Returns:
- Parent.
-
setParent
public void setParent(ANode node)
Set parent.- Parameters:
node- Parent.
-
getMapParent
public NodeMap getMapParent()
Get Node map.- Returns:
- Node map.
-
setMapParent
public void setMapParent(NodeMap nodeMap)
Set Node map.- Parameters:
nodeMap- Node map.
-
getSurroundingNodes
public ANode[] getSurroundingNodes()
Get Surrouding nodes.- Returns:
- Surrouding nodes.
-
ComputeHeuristic
public double ComputeHeuristic(ANode Target)
Compute heuristic in the specified ANode.- Parameters:
Target- ANode.- Returns:
- Heuristic.
-
ComputeHeuristic
public double ComputeHeuristic(int x, int y)Compute heuristic in the specified ANode.- Parameters:
x- X axis coordinate.y- Y axis coordinate.- Returns:
- Heuristic.
-
clone
public ANode clone(NodeMap parent)
Clone this ANode.- Parameters:
parent- Parent.- Returns:
- ANode.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG