public class BasicLinearMover extends SimEntityBase implements Mover
Modifier and Type | Field and Description |
---|---|
protected double |
currentSpeed |
protected java.awt.geom.Point2D |
destination |
static java.text.DecimalFormat |
FORM
For formatting numbers to enhance readability when debugging
|
private java.awt.geom.Point2D |
initialLocation |
protected java.awt.geom.Point2D |
lastStopLocation |
private double |
maxSpeed |
static java.awt.geom.Point2D |
NaP
"Not a Point"
|
protected double |
startMoveTime |
protected java.awt.geom.Point2D |
velocity |
eventList, property
DEFAULT_ENTITY_NAME, DEFAULT_EVENT_NAME, DEFAULT_PRIORITY, EVENT_METHOD_PREFIX, NL
Constructor and Description |
---|
BasicLinearMover()
Zero-parameter constructor for Javabeans support and for building from
input data by instantiating, then setting parameters.
|
BasicLinearMover(java.awt.geom.Point2D initialLocation,
double maxSpeed)
Instantiate a BasicLinearMover with the given initialLocation maxSpeed.
|
BasicLinearMover(java.lang.String name,
java.awt.geom.Point2D initialLocation,
double maxSpeed)
Instantiate a BasicLinearMover with the given name, initialLocation, and
maxSpeed.BasicLinearMover
|
Modifier and Type | Method and Description |
---|---|
void |
doEndMove(Mover me)
After this event, the Mover may immediately be ordered to move again.
|
void |
doMoveTo(java.awt.geom.Point2D dest)
Start moving at maximum speed to destination.
|
void |
doMoveTo(java.awt.geom.Point2D dest,
double desiredSpeed)
Start moving at desiredSpeed to destination indicated.
|
void |
doOrderStop(Mover mover)
Event scheduled by another component that orders this Mover to actually
stop.
|
void |
doRun()
Schedule RegisterMover(this) for listeners at start of run.
|
void |
doStartMove(Mover me)
Set startMoveTime to simTime, set velocity to match current speed and
destination.
|
void |
doStop(Mover mover)
Full stop.
|
java.awt.geom.Point2D |
getCurrentLocation()
Derived state from initial conditions of equation of motion: x(t) = x0 +
(t - t0) v
|
double |
getCurrentSpeed() |
java.awt.geom.Point2D |
getDestination() |
java.awt.geom.Point2D |
getInitialLocation() |
java.awt.geom.Point2D |
getLastStopLocation() |
double |
getMaxSpeed() |
double |
getStartMoveTime() |
java.awt.geom.Point2D |
getVelocity() |
boolean |
isMoving() |
java.lang.String |
paramString() |
void |
reset()
lastStopLocation set to initialLocation; speed and velocity set to 0,
destination set to "NaN" Point2D.
|
void |
setInitialLocation(java.awt.geom.Point2D initialLocation) |
void |
setMaxSpeed(double maxSpeed) |
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, 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
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.text.DecimalFormat FORM
public static final java.awt.geom.Point2D NaP
private java.awt.geom.Point2D initialLocation
private double maxSpeed
protected double startMoveTime
protected java.awt.geom.Point2D lastStopLocation
protected java.awt.geom.Point2D velocity
protected java.awt.geom.Point2D destination
protected double currentSpeed
public BasicLinearMover()
public BasicLinearMover(java.lang.String name, java.awt.geom.Point2D initialLocation, double maxSpeed)
name
- Name for identification purposesinitialLocation
- initial location of MovermaxSpeed
- maximum possible speedpublic BasicLinearMover(java.awt.geom.Point2D initialLocation, double maxSpeed)
initialLocation
- initial location of MovermaxSpeed
- maximum possible speedpublic void reset()
reset
in interface ReRunnable
reset
in class BasicSimEntity
public void doRun()
public void doMoveTo(java.awt.geom.Point2D dest, double desiredSpeed)
dest
- destinationdesiredSpeed
- speed to movepublic void doMoveTo(java.awt.geom.Point2D dest)
dest
- destinationpublic void doStartMove(Mover me)
doStartMove
in interface Mover
me
- Reference to this Mover for listener purposespublic void doEndMove(Mover me)
me
- Reference to this Mover for listener purposespublic void doOrderStop(Mover mover)
mover
- This Moverpublic void doStop(Mover mover)
public java.awt.geom.Point2D getCurrentLocation()
getCurrentLocation
in interface Mover
public java.awt.geom.Point2D getInitialLocation()
public void setInitialLocation(java.awt.geom.Point2D initialLocation)
initialLocation
- the initialLocation to setpublic double getMaxSpeed()
getMaxSpeed
in interface Mover
public void setMaxSpeed(double maxSpeed)
maxSpeed
- the maxSpeed to setpublic double getStartMoveTime()
public java.awt.geom.Point2D getLastStopLocation()
public java.awt.geom.Point2D getVelocity()
getVelocity
in interface Mover
public java.awt.geom.Point2D getDestination()
public boolean isMoving()
public java.lang.String toString()
BasicSimEntity
toString
in class BasicSimEntity
public java.lang.String paramString()
public double getCurrentSpeed()