public static class HeuristicPathTree.Node extends Object
Modifier and Type | Field and Description |
---|---|
private boolean |
accessible |
private float |
accumulative |
private ArrayList<HeuristicPathTree.Node> |
children |
private float |
cost |
private HeuristicPathTree.Node |
father |
private String |
name |
private int |
posX |
private int |
posY |
private float |
remaining |
private StringBuilder |
step |
Constructor and Description |
---|
Node(String name,
float cost,
boolean accessible,
int y,
int x)
Constructor of the Heuristic Algorithm Node.
|
Modifier and Type | Method and Description |
---|---|
private void |
addChild(HeuristicPathTree.Node child)
Add a child to a specific father node.
|
float |
getAccumulative()
Get the accumulative value of the node.
|
ArrayList<HeuristicPathTree.Node> |
getChildren()
Get the children related to a certain node.
|
float |
getCost()
Get the current cost of a node.
|
HeuristicPathTree.Node |
getFather()
Get the father related to a certain node.
|
String |
getName()
Get the name of the node.
|
int |
getPosX()
Get the X coordinate from a node.
|
int |
getPosY()
Get the Y coordinate of the node.
|
float |
getRemaining()
Get the remaining value from the current node to the final node.
|
String |
getStep()
Get the current step of the algorithm.
|
boolean |
isAccessible()
Check if a node is accessible by the character.
|
boolean |
isFinal(int y,
int x)
Check if the actual node is the final node.
|
void |
setAccessible(boolean accessible)
Method to set a node as accessible or not to the character.
|
void |
setAccumulative(float accumulative)
Method to get the accumulative value of the node.
|
void |
setCost(float cost)
Set the current cost to the node.
|
void |
setFather(HeuristicPathTree.Node father)
Set a father to a certain node.
|
void |
setName(String name)
Set the name to a node.
|
void |
setPosX(int posX)
Set the X coordinate to a node.
|
void |
setPosY(int posY)
Set y coordinate to a node.
|
void |
setRemaining(float remaining)
Set the remaining value from a certain node to the final node.
|
void |
setStep(int step)
Set the current step to the node.
|
void |
setStep(StringBuilder step)
Set the current step to the node.
|
private ArrayList<HeuristicPathTree.Node> children
private HeuristicPathTree.Node father
private StringBuilder step
private String name
private float cost
private int posY
private int posX
private float accumulative
private float remaining
private boolean accessible
public Node(String name, float cost, boolean accessible, int y, int x)
name
- Name of the node.cost
- Cost of the node.accessible
- Whether the node is accessible to the character or not.y
- Y coordinate.x
- X coordinate.public boolean isAccessible()
public boolean isFinal(int y, int x)
y
- Y coordinate.x
- X coordinate.public void setAccessible(boolean accessible)
accessible
- boolean variable.public void setStep(StringBuilder step)
step
- Step number.public int getPosY()
public void setPosY(int posY)
posY
- Y coordinate.public int getPosX()
public void setPosX(int posX)
posX
- X coordinate.public float getAccumulative()
public void setAccumulative(float accumulative)
accumulative
- accumulative value of the node.public float getRemaining()
public void setRemaining(float remaining)
remaining
- remaining value.public ArrayList<HeuristicPathTree.Node> getChildren()
private void addChild(HeuristicPathTree.Node child)
child
- Child node to be added to the father.public HeuristicPathTree.Node getFather()
public void setFather(HeuristicPathTree.Node father)
father
- Father node.public String getStep()
public void setStep(int step)
step
- current step.public String getName()
public void setName(String name)
name
- Node name.public float getCost()
public void setCost(float cost)
cost
- Current cost.