public class PathMoverManager extends SimEntityBase
Modifier and Type | Field and Description |
---|---|
private Mover |
mover
The one Mover this instance is managing
|
protected java.util.ListIterator<WayPoint> |
nextWayPointIter
Points to next WayPoint if hasNext() is true.
|
private boolean |
startOnRun
If true, then start Mover from Run event
|
private java.util.List<WayPoint> |
wayPoint
List of desired WayPoints the Mover is to traverse
|
eventList, property
DEFAULT_ENTITY_NAME, DEFAULT_EVENT_NAME, DEFAULT_PRIORITY, EVENT_METHOD_PREFIX, NL
Constructor and Description |
---|
PathMoverManager() |
PathMoverManager(Mover mover)
Empty list of waypoints; startOnRun is false.
|
PathMoverManager(Mover mover,
boolean startOnRun)
Empty list of waypoints
|
PathMoverManager(Mover mover,
java.util.LinkedList<WayPoint> waypoint)
startOnRun defaults to "false"
|
PathMoverManager(Mover mover,
java.util.List<WayPoint> waypoint,
boolean startOnRun)
Instantiate a PathMoverManager with the given Mover, WayPoints, and
whether to start immediately or wait.
|
Modifier and Type | Method and Description |
---|---|
void |
doEndMove(Mover mover)
Heard from mover.
|
void |
doMoveTo(java.awt.geom.Point2D destination,
double speed)
Empty - to be heard.
|
void |
doRun()
If startOnRun is true, schedule Start.
|
void |
doStart()
If there is a WayPoint, schedule StartMove(d, s), where d is the location
and s is the speed specified by the WayPoint objst.
|
void |
doStop()
Schedule OrderStop(mover).
|
Mover |
getMover() |
WayPoint |
getNextWayPoint()
This is a derived state from waypoint and nextWayPointIter
|
java.util.ListIterator<WayPoint> |
getNextWayPointIter()
This is for purety and consistency since this is a state variable.
|
java.util.List<WayPoint> |
getWaypoint() |
boolean |
isStartOnRun()
If true, start moving at beginning of simulation
|
void |
reset()
Set nextWayPointIter to beginning of waypoint
|
void |
setMover(Mover mover) |
void |
setStartOnRun(boolean startOnRun) |
void |
setWaypoint(java.util.List<WayPoint> waypoint) |
coldReset, dumpDoMethods, dumpDoMethodsStr, dumpNamesAndSignatures, dumpNamesAndSignaturesStr, getFullMethodName, getSignatureString, handleSimEvent, isAssignableFrom, isDebug, processSimEvent, setDebug, stopAtTime, stopOnTime
addPropertyChangeListener, addPropertyChangeListener, attemptSchedule, clearAddedProperty, compareTo, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAddedProperties, getEventList, getEventListID, getName, getPriority, getPropertiesString, getProperty, getProperty, getPropertyChangeListeners, getSerial, interrupt, interrupt, interruptAll, interruptAll, interruptAll, interruptAllWithArgs, interruptAllWithArgs, isClearAddedPropertiesOnReset, isJustDefinedProperties, isPersistant, isReRunnable, isVerbose, parametersMatch, removePropertyChangeListener, removePropertyChangeListener, resetNextSerial, setClearAddedPropertiesOnReset, setEventList, setEventListID, setJustDefinedProperties, setName, setPersistant, setPriority, setProperty, setVerbose, toString, waitDelay, waitDelay, waitDelay, waitDelay
addSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListener
private java.util.List<WayPoint> wayPoint
protected java.util.ListIterator<WayPoint> nextWayPointIter
private boolean startOnRun
private Mover mover
public PathMoverManager()
public PathMoverManager(Mover mover, java.util.List<WayPoint> waypoint, boolean startOnRun)
mover
- My Moverwaypoint
- List of WayPoints to traversestartOnRun
- If true, start from Run eventpublic PathMoverManager(Mover mover, java.util.LinkedList<WayPoint> waypoint)
mover
- My Moverwaypoint
- List of WayPoints to traversepublic PathMoverManager(Mover mover, boolean startOnRun)
mover
- My MoverstartOnRun
- If true, Run event schedules StartEventpublic PathMoverManager(Mover mover)
mover
- My Moverpublic void reset()
reset
in interface ReRunnable
reset
in class BasicSimEntity
public void doRun()
public void doStart()
public void doMoveTo(java.awt.geom.Point2D destination, double speed)
destination
- desired destinationspeed
- desired speedpublic void doEndMove(Mover mover)
mover
- My moverpublic void doStop()
public java.util.List<WayPoint> getWaypoint()
public void setWaypoint(java.util.List<WayPoint> waypoint)
waypoint
- the wayPoint to setpublic boolean isStartOnRun()
public void setStartOnRun(boolean startOnRun)
startOnRun
- the startOnRun to setpublic Mover getMover()
public void setMover(Mover mover)
mover
- the mover to setpublic java.util.ListIterator<WayPoint> getNextWayPointIter()
public WayPoint getNextWayPoint()