public class FormationMoverManager extends SimEntityBase implements MoverManager
Modifier and Type | Class and Description |
---|---|
protected static class |
FormationMoverManager.SurrogateTarget
A Mover with the minimum functionality to provide the data needed to be
the target Mover in Math2D.getIntercept().
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
_VERSION_ |
protected double |
cruisingSpeed
The speed that the Mover should initially try to move to regain station.
|
protected FormationLeader |
leader
The FormationLeader that is the guide for the formation.
|
static java.util.logging.Logger |
log |
protected Mover |
mover
The Mover this manager controls.
|
protected StationData |
originalStation
The station that the Mover to take at the start of the simulation.
|
protected StationData |
station
The data used to determine the location relative to the FormationLeader.
|
protected double |
stationTolerance
How close we need to be to our station.
|
eventList, property
DEFAULT_ENTITY_NAME, DEFAULT_EVENT_NAME, DEFAULT_PRIORITY, EVENT_METHOD_PREFIX, NL
Constructor and Description |
---|
FormationMoverManager() |
FormationMoverManager(Mover m)
Makes a new manager for the given Mover.
|
Modifier and Type | Method and Description |
---|---|
protected void |
changeStation()
Get the next station point, if close enough to it, then move with
leader's velocity, if not, intercept the point.
|
void |
doEndMove(Mover m)
If heard from the Mover, then pick a new station point and start moving
to it.
|
void |
doRun()
Pick a new station point and start moving to it.
|
void |
doStartMove(Moveable m)
If heard from the FormationLeader, then pick a new station point and
start moving to it.
|
double |
getCruisingSpeed() |
FormationLeader |
getFormationLeader() |
Mover |
getMover()
The Mover this manager controls.
|
boolean |
isMoving()
True if the controlled Mover is moving.
|
boolean |
isStartOnReset()
Always returns true.
|
void |
reset()
Resets to the initial station value.
|
void |
setCruisingSpeed(double value)
The speed that the Mover should initially try to move to regain station.
|
void |
setFormationLeader(FormationLeader value) |
void |
setMover(Mover value)
The Mover this manager controls.
|
void |
setOriginalStationData(StationData value)
The data used to determine the location relative to the FormationLeader.
|
void |
setStartOnReset(boolean value)
Does nothing since the FormationMoverManager always starts on reset().
|
void |
setStationTolerance(double value) |
void |
start()
Pick a new station point and start moving to it.
|
void |
stop()
Stops the Mover.
|
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
getEventListID, setEventListID
addSimEventListener, getSimEventListeners, notifyListeners, removeSimEventListener
processSimEvent
isPersistant, isReRunnable, setPersistant
getEventList, getPriority, getSerial, handleSimEvent, interrupt, interrupt, interruptAll, interruptAll, interruptAll, interruptAllWithArgs, interruptAllWithArgs, setPriority, waitDelay, waitDelay
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, getAddedProperties, getProperty, getProperty, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener, setProperty
public static final java.lang.String _VERSION_
public static final java.util.logging.Logger log
protected StationData station
protected StationData originalStation
protected Mover mover
protected FormationLeader leader
protected double stationTolerance
protected double cruisingSpeed
public FormationMoverManager(Mover m)
m
- Given Moverpublic FormationMoverManager()
public void setStationTolerance(double value)
value
- How close we need to be to our station.public void setFormationLeader(FormationLeader value)
value
- The FormationLeader that is the guide for the formation.public FormationLeader getFormationLeader()
public void setOriginalStationData(StationData value)
value
- Given StationDatapublic double getCruisingSpeed()
public void setCruisingSpeed(double value)
value
- Given cruising speedpublic void setMover(Mover value)
setMover
in interface MoverManager
value
- the Mover to be controlled by this MoverManagerpublic Mover getMover()
getMover
in interface MoverManager
public void setStartOnReset(boolean value)
setStartOnReset
in interface MoverManager
value
- true if after a reset, this MoverManager will re-start the
motion of the controlled Mover.public boolean isStartOnReset()
isStartOnReset
in interface MoverManager
public void stop()
stop
in interface MoverManager
public void start()
start
in interface MoverManager
public void doRun()
public void doEndMove(Mover m)
doEndMove
in interface MoverManager
m
- Given Moverpublic void doStartMove(Moveable m)
m
- Should be reference to FormationLeaderpublic void reset()
reset
in interface ReRunnable
reset
in class BasicSimEntity
public boolean isMoving()
isMoving
in interface MoverManager
protected void changeStation()