|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vanetsim.routing.A_Star.A_Star_Node
public final class A_Star_Node
A node specific for the computation in an A*-algorithm.
Constructor Summary | |
---|---|
A_Star_Node(Node realNode,
double f,
int counter)
Instantiates a new A_Star_Node from a node existing on the map. |
|
A_Star_Node(Node realNode,
int counter)
Instantiates a new A_Star_Node from a node existing on the map. |
Method Summary | |
---|---|
int |
compareTo(java.lang.Object other)
Function needed to implement the Comparable interface. |
int |
getCounter()
Returns the current value for the counter |
double |
getF()
Gets the f value (=approximated distance/time/penalty... from this point to the target). |
double |
getG()
Gets the g value (=distance/time/penalty... from this point to the beginning). |
A_Star_Node |
getPredecessor()
Gets the predecessor of this node. |
Node |
getRealNode()
Gets the "real" node in the map associated with this A*-specific node. |
boolean |
isInClosedList()
Returns if this node is in the ClosedList. |
boolean |
isInOpenList()
Returns if this node is in the OpenList. |
void |
reset(int counter)
Resets the values of the node to the default values so that it can be reused. |
void |
setF(double f)
Sets the f value (=approximated distance/time/penalty... from this point to the target). |
void |
setG(double g)
Sets the g value (=distance/time/penalty... from this point to the beginning). |
void |
setInClosedList(boolean state)
Sets if this node is in the ClosedList or not. |
void |
setInOpenList(boolean state)
Sets if this node is in the OpenList or not. |
void |
setPredecessor(A_Star_Node predecessor)
Sets the predecessor of this node. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public A_Star_Node(Node realNode, double f, int counter)
realNode
- the real node from the map associated with this A*-specific nodef
- the initial value for the approximate distance/time/penalty... to the targetcounter
- a value to determine if this node is valid for the current routing calculationpublic A_Star_Node(Node realNode, int counter)
realNode
- the real node from the map associated with this A*-specific nodecounter
- a value to determine if this node is valid for the current routing calculationMethod Detail |
---|
public void reset(int counter)
counter
- a value to determine if this node is valid for the current routing calculationpublic int getCounter()
public boolean isInClosedList()
true
if node is already in ClosedList, else false
public void setInClosedList(boolean state)
state
- true
if this node shall be in the ClosedList, else false
public boolean isInOpenList()
true
if node is already in OpenList, else false
public void setInOpenList(boolean state)
state
- true
if this node shall be in the OpenList, else false
public double getF()
public void setF(double f)
f
- the new f valuepublic double getG()
public void setG(double g)
g
- the new g valuepublic A_Star_Node getPredecessor()
public void setPredecessor(A_Star_Node predecessor)
predecessor
- the new predecessorpublic Node getRealNode()
public int compareTo(java.lang.Object other)
Comparable
interface. This allows automatic sorting of this node
in a SortedSet
like a TreeSet
based on it's f-value.
compareTo
in interface java.lang.Comparable<java.lang.Object>
other
- object to compare this node with
0
if other
is the same, 1
if this is greater than other
and -1
if this is less than other
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |