public class RandomMoverManager extends SimEntityBase
Modifier and Type | Field and Description |
---|---|
private RandomVariate[] |
coordinate |
private Mover |
mover |
private boolean |
startOnRun |
eventList, property
DEFAULT_ENTITY_NAME, DEFAULT_EVENT_NAME, DEFAULT_PRIORITY, EVENT_METHOD_PREFIX, NL
Constructor and Description |
---|
RandomMoverManager() |
RandomMoverManager(Mover mover,
RandomVariate[] coordinate,
boolean startOnRun)
Instantiate a RandomMoverManager with the given Mover,
Random coordinate generators and whether to start immediately.
|
Modifier and Type | Method and Description |
---|---|
void |
doEndMove(BasicLinearMover mover)
Generate another random destination d and schedule MoveTo(d)
|
void |
doMoveTo(java.awt.geom.Point2D destination)
Empty - to be heard by Mover
|
void |
doOrderStop(Mover mover)
Empty - heard by Mover
|
void |
doRun()
If startOnRun is true, schedule Start.
|
void |
doStart()
Schedule MoveTo(d) where d is a Point2D with randomly generated
coordinates
|
void |
doStop()
Schedule OrderStop(mover).
|
RandomVariate[] |
getCoordinate() |
Mover |
getMover() |
boolean |
isStartOnRun() |
java.lang.String |
paramString() |
void |
setCoordinate(RandomVariate[] coordinate) |
void |
setMover(Mover mover) |
void |
setStartOnRun(boolean startOnRun) |
java.lang.String |
toString()
A default string description of this entity, name (Entity Priority)
<list of all properties as key = value pairs>
|
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, reset, resetNextSerial, setClearAddedPropertiesOnReset, setEventList, setEventListID, setJustDefinedProperties, setName, setPersistant, setPriority, setProperty, setVerbose, waitDelay, waitDelay, waitDelay, waitDelay
addSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListener
private RandomVariate[] coordinate
private boolean startOnRun
private Mover mover
public RandomMoverManager()
public RandomMoverManager(Mover mover, RandomVariate[] coordinate, boolean startOnRun)
mover
- My Movercoordinate
- RandomVariate array to generate coordinatesstartOnRun
- If true, start from Run eventpublic void doRun()
public void doStart()
public void doMoveTo(java.awt.geom.Point2D destination)
destination
- Given destinationpublic void doEndMove(BasicLinearMover mover)
mover
- My Moverpublic void doStop()
public void doOrderStop(Mover mover)
mover
- My Moverpublic RandomVariate[] getCoordinate()
public void setCoordinate(RandomVariate[] coordinate)
coordinate
- the coordinate 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.lang.String paramString()
public java.lang.String toString()
BasicSimEntity
toString
in class BasicSimEntity