public class RandomLocationMoverManager extends SimEntityBase implements MoverManager
MoverManagerFactory| Modifier and Type | Field and Description |
|---|---|
private RandomVariate[] |
location
A 2-dimensional array that contains a RandomVariate for the x coordinate
and the y coordinate.
|
private Mover |
mover
The Mover that this MoverManager manages.
|
private RandomVariate |
speed
The RandomVariate for the speedGen of movement.
|
private boolean |
startOnReset
If true, then after a reset, this MoverManager will re-start the motion
of the controlled Mover.
|
eventList, propertyDEFAULT_ENTITY_NAME, DEFAULT_EVENT_NAME, DEFAULT_PRIORITY, EVENT_METHOD_PREFIX, NL| Constructor and Description |
|---|
RandomLocationMoverManager() |
RandomLocationMoverManager(Mover mover,
RandomVariate[] location)
Creates a new instance of RandomLocationMoverManager that moves the Mover
at its maximum speedGen.
|
RandomLocationMoverManager(Mover mover,
RandomVariate[] location,
RandomVariate speed)
Creates a new instance of RandomLocationMoverManager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
doEndMove(Mover m)
Notifies this MoverManager that the Mover has completed the current move
causing the Mover to move to another random point.
|
void |
doStart()
Causes the Mover to start moving to a random point.
|
protected java.awt.geom.Point2D |
getLocation() |
RandomVariate[] |
getLocationGenerator() |
Mover |
getMover()
The Mover that this MoverManager manages.
|
RandomVariate |
getSpeedGenerator() |
boolean |
isMoving()
True if the Mover controlled by this MoverManager is moving.
|
boolean |
isStartOnReset()
If true, then after a reset, this MoverManager re-starts the motion of
the controlled Mover.
|
void |
reset()
Cancels all pending events for this MoverManager and if startOnReset is
true, starts the Mover's motion.
|
void |
setLocationGenerator(RandomVariate[] rv)
Sets the RandomVariates used to pick the next x and y coordinates.
|
void |
setMover(Mover newMover)
Sets the Mover that this MoverManager controls.
|
void |
setSpeedGenerator(RandomVariate rv)
Sets the RandomVariate used to pick the speedGen for the next leg.
|
void |
setStartOnReset(boolean b)
If true, then after a reset, this MoverManager re-starts the motion of
the controlled Mover.
|
void |
start()
Starts the controlled Mover moving to a random location.
|
void |
stop()
Stops the Mover at its current location.
|
java.lang.String |
toString()
Returns a String containing the mover, the next position, and the transit
speedGen.
|
coldReset, dumpDoMethods, dumpDoMethodsStr, dumpNamesAndSignatures, dumpNamesAndSignaturesStr, getFullMethodName, getSignatureString, handleSimEvent, isAssignableFrom, isDebug, processSimEvent, setDebug, stopAtTime, stopOnTimeaddPropertyChangeListener, 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, waitDelay, waitDelay, waitDelay, waitDelayaddSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetEventListID, setEventListIDaddSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListenerprocessSimEventisPersistant, isReRunnable, setPersistantgetEventList, getPriority, getSerial, handleSimEvent, interrupt, interrupt, interruptAll, interruptAll, interruptAll, interruptAllWithArgs, interruptAllWithArgs, setPriority, waitDelay, waitDelayaddPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getAddedProperties, getProperty, getProperty, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener, setPropertyprivate Mover mover
private RandomVariate[] location
private RandomVariate speed
private boolean startOnReset
public RandomLocationMoverManager()
public RandomLocationMoverManager(Mover mover, RandomVariate[] location, RandomVariate speed)
mover - The Mover that this MoverManager controls.location - A 2-dimensional array containing a RandomVariate for the
x coordinate and one for the y coordinate.speed - The RandomVariate used to determine the speedGen of the moves.public RandomLocationMoverManager(Mover mover, RandomVariate[] location)
mover - The Mover that this MoverManager controls.location - A 2-dimensional array containing a RandomVariate for the
x coordinate and one for the y coordinate.public void reset()
reset in interface ReRunnablereset in class BasicSimEntitypublic void doStart()
public void doEndMove(Mover m)
doEndMove in interface MoverManagerm - Given Moverpublic Mover getMover()
getMover in interface MoverManagerpublic boolean isMoving()
isMoving in interface MoverManagerpublic boolean isStartOnReset()
isStartOnReset in interface MoverManagerpublic void setStartOnReset(boolean b)
setStartOnReset in interface MoverManagerb - true if after a reset, this MoverManager will re-start the
motion of the controlled Mover.public void start()
start in interface MoverManagerpublic void stop()
stop in interface MoverManagerpublic void setLocationGenerator(RandomVariate[] rv)
rv - A 2-dimensional array containing the RandomVariate for the x
and y coordinates.java.lang.NullPointerException - If the array or either of its contents is
null.java.lang.IllegalArgumentException - If the array does not contain at least 2
elements.public RandomVariate[] getLocationGenerator()
public void setSpeedGenerator(RandomVariate rv)
rv - Given RandomVariate to generate speedspublic RandomVariate getSpeedGenerator()
protected java.awt.geom.Point2D getLocation()
public void setMover(Mover newMover)
setMover in interface MoverManagernewMover - the Mover to be controlled by this MoverManagerpublic java.lang.String toString()
toString in class BasicSimEntity