|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectPER.rover.SmartWanderAction
Allows the rover to explore an area without running in to things. The rover will drive in a straight line until it encounters an obstacle, then it turns on the light to examine the obstacle. The rover then chooses a random angle, checks if the new heading is unobstructed, and drives in the new direction. If the rover does not see a clear area after checking several angles, it will turn in the hope of finding a better path from the new vantage point.
| Constructor Summary | |
SmartWanderAction(int seconds)
Creates a new instance of SmartWanderAction that takes pictures as it moves. |
|
SmartWanderAction(int seconds,
boolean takePictures)
Creates a new instance of SmartWanderAction. |
|
| Method Summary | |
boolean |
doAction(Rover r)
Tries to start the action. |
long |
getImageUpdateTime()
Lets you know when the last image was taken by this action. |
java.awt.image.BufferedImage |
getRecentImage()
Returns the most recent image taken by this Action. |
int |
getReturnValue()
The return value of the Action. |
java.lang.String |
getShortSummary()
Provides a shortened version of the summary returned by getSummary. |
java.lang.String |
getSummary()
Provides a textual explanation of the Action, such as "turn 90 degrees" |
int |
getTime()
How long the action will take, in milliseconds. |
int |
getTimeRemaining()
How much time until the action finishes (in milliseconds), if it has already started. |
boolean |
isCompleted()
Whether the action has completed. |
boolean |
isSuccess()
Returns true if the time limit expired without the occurance of any errors. |
void |
kill()
Emergency stop - end the action immediately, if it's running. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SmartWanderAction(int seconds)
seconds - the length of time to wander in seconds
public SmartWanderAction(int seconds,
boolean takePictures)
seconds - the length of time to wander in secondstakePictures - if true, the rover will take pictures while
turning and driving| Method Detail |
public boolean doAction(Rover r)
Action
doAction in interface Actionpublic int getReturnValue()
Action
getReturnValue in interface ActionRoverState,
ActionConstantspublic java.lang.String getShortSummary()
Action
getShortSummary in interface Actionpublic java.lang.String getSummary()
Action
getSummary in interface Actionpublic int getTime()
Action
getTime in interface Actionpublic int getTimeRemaining()
Action
getTimeRemaining in interface Actionpublic boolean isCompleted()
Action
isCompleted in interface Actionpublic boolean isSuccess()
isSuccess in interface Actionpublic void kill()
Action
kill in interface Actionpublic long getImageUpdateTime()
Action
getImageUpdateTime in interface Actionpublic java.awt.image.BufferedImage getRecentImage()
Action
getRecentImage in interface Action
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||