|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectSearchNode
RoadPoints
public class RoadPoints
RoadPoints.java Created: Mon Nov 29 21:50:36 2004
| Field Summary |
|---|
| Fields inherited from class SearchNode |
|---|
depth, parent |
| Constructor Summary | |
|---|---|
RoadPoints(int index)
Creates a new RoadPoints instance. |
|
| Method Summary | |
|---|---|
void |
addChild(RoadPoints child)
addChild - this method adds a child to the
children vector |
java.util.Vector |
expand()
expand - method is used in the
BreadthFirstSearcher to find the optimal path for the robot, it
returns the children of the current road point |
int |
getIndex()
getIndex - returns the index of the road point
(this index is specified by the programmer in the Map class) |
boolean |
isConnected(RoadPoints point)
isConnected - this method will return whether the
current node is a parent of another node that is specified in
the parameters of the method |
boolean |
isGoal()
isGoal - returns a boolean value of whether this
point is the goal or not |
void |
setGoal()
setGoal - will change the isGoal boolean from
false to true, making it the goal for the robot |
java.lang.String |
toString()
toString - returns a string representation of the
road point. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public RoadPoints(int index)
RoadPoints instance.
When the roadPoint is initialized, it initializes the index to
a given integer and initializes the vector of children
(children will be entered later)
index - an int value - the index of the
roadPoint| Method Detail |
|---|
public void addChild(RoadPoints child)
addChild - this method adds a child to the
children vector
child - a RoadPoints value - a RoadPoint this
is connected topublic void setGoal()
setGoal - will change the isGoal boolean from
false to true, making it the goal for the robot
public boolean isConnected(RoadPoints point)
isConnected - this method will return whether the
current node is a parent of another node that is specified in
the parameters of the method
point - a RoadPoints value - the child in question
boolean value - returns true if the two
road points are connected, otherwise returns falsepublic java.util.Vector expand()
expand - method is used in the
BreadthFirstSearcher to find the optimal path for the robot, it
returns the children of the current road point
expand in class SearchNodeVector value - the children of the road
pointpublic boolean isGoal()
isGoal - returns a boolean value of whether this
point is the goal or not
isGoal in class SearchNodeboolean value - returns true if this
point is the goal, false otherwisepublic int getIndex()
getIndex - returns the index of the road point
(this index is specified by the programmer in the Map class)
int value - returns the index of the
road pointpublic java.lang.String toString()
toString - returns a string representation of the
road point. Since the point does not have too many variables,
it simply returns the point's index as a string.
toString in class java.lang.ObjectString value
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||