protected static class FormationMoverManager.SurrogateTarget extends java.lang.Object implements Mover
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.geom.Point2D |
initialLocation
The initial location.
|
protected double |
initialTime
The time this surrogate was constructed.
|
static java.lang.String |
MESSAGE |
protected java.awt.geom.Point2D |
velocity
The velocity of the leader and therefore the station point.
|
DEFAULT_ENTITY_NAME, DEFAULT_EVENT_NAME, DEFAULT_PRIORITY, EVENT_METHOD_PREFIX, NL| Modifier | Constructor and Description |
|---|---|
protected |
SurrogateTarget(java.awt.geom.Point2D point,
Mover leader)
Creates a new surrogate based on the given initial location and the
velocity of the given Mover.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accelerate(java.awt.geom.Point2D p)
Accelerate with the given acceleration vector.
|
void |
accelerate(java.awt.geom.Point2D a,
double speed)
Accelerate in the direction of the given acceleration vector
to the given speed.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this PropertyChangeSource.
|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to this PropertyChangeSource for a specific property.
|
void |
addSimEventListener(SimEventListener l)
Registers a listener.
|
int |
compareTo(SimEntity other) |
void |
doEndMove(Moveable mover)
Event that signals that this Mover has reached its desired location.
|
void |
doStartMove(Moveable mover)
Event that signals the start of a move to a previously set destination.
|
void |
firePropertyChange(java.beans.PropertyChangeEvent event)
Notify all PropertyChangeListeners of the PropertyChangeEvent.
|
java.awt.geom.Point2D |
getAcceleration() |
java.lang.String[] |
getAddedProperties() |
EventList |
getEventList() |
int |
getEventListID() |
java.awt.geom.Point2D |
getLocation()
The current location of the point.
|
double |
getMaxSpeed() |
MovementState |
getMovementState() |
java.lang.String |
getName() |
Priority |
getPriority()
If two events occur at the same time with the same event priority,
the one with the highest entity priority will be processed first.
|
java.lang.Object |
getProperty(java.lang.String name)
Get the value of a property
|
java.lang.Object |
getProperty(java.lang.String name,
java.lang.Object defaultValue)
Get the value of a property if able; if not able return the
provided default value.
|
java.beans.PropertyChangeListener[] |
getPropertyChangeListeners()
Get an Array containing all of the PropertyChangeListeners.
|
int |
getSerial() |
SimEventListener[] |
getSimEventListeners()
Get an array containing all registered listeners.
|
java.awt.geom.Point2D |
getVelocity()
The current velocity of the point.
|
void |
handleSimEvent(SimEvent e)
Typically an Event is handled (as opposed to processed, as in SimEventListener)
by actually executing a method.
|
void |
interrupt(java.lang.String eventName)
Cancels the next event for this entity that matches the event name.
|
void |
interrupt(java.lang.String n,
java.lang.Object... o)
Interrupt (cancel) the next pending event with name eventName
and interruption parameter array "parameters"
belonging to this object.
|
void |
interruptAll()
Interrupt (cancel) all pending events for this entity.
|
void |
interruptAll(java.lang.String eventName)
Cancels all events for this entity that match the event name.
|
void |
interruptAll(java.lang.String n,
java.lang.Object... o)
Interrupt (cancel) all pending events with name eventName
and interruption parameter array "parameters"
belonging to this object.
|
void |
interruptAllWithArgs(java.lang.Object parameter)
Interrupt (cancel) all events scheduled by this component having
the given eventName and an argument matching the parameter.
|
void |
interruptAllWithArgs(java.lang.String eventName,
java.lang.Object parameter)
Interrupt (cancel) all events scheduled by this component having
the given eventName and an argument matching the parameter.
|
boolean |
isClearAddedPropertiesOnReset() |
boolean |
isMoving() |
boolean |
isPersistant() |
boolean |
isReRunnable() |
void |
magicMove(java.awt.geom.Point2D loc)
Instantly move to the given location.
|
void |
move(java.awt.geom.Point2D vel)
Move with the given velocity.
|
void |
moveTo(java.awt.geom.Point2D d)
Causes this Mover to move to the given destination at
its maximum speed.
|
void |
moveTo(java.awt.geom.Point2D d,
double t)
Causes this Mover to move to the given destination at the
given speed.
|
void |
notifyListeners(SimEvent e)
Notify registered listeners by calling their processSimEvent method.
|
java.lang.String |
paramString() |
void |
pause()
Pause at the current location.
|
void |
processSimEvent(SimEvent event)
Process the fired SimEvent.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Causes the PropertyChangeListener to stop listening.
|
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Causes the PropertyChangeListener to stop listening.
|
void |
removeSimEventListener(SimEventListener l)
Unregister a listener.
|
void |
reset()
Implementing classes with state variables should initialize them in
their overridden reset() method.
|
void |
setClearAddedPropertiesOnReset(boolean b) |
void |
setEventListID(int id) |
void |
setLocation(java.awt.geom.Point2D location)
Added to support zero argument constructors and the ObjectMaker system.
|
void |
setMaxSpeed(double max)
Added to support zero argument constructors and the ObjectMaker system.
|
void |
setName(java.lang.String n) |
void |
setPersistant(boolean p) |
void |
setPriority(Priority d)
If two events occur at the same time with the same event priority,
the one with the highest entity priority will be processed first.
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
Set the given property to the given value.
|
void |
stop()
Stops at the current location.
|
SimEvent |
waitDelay(java.lang.String n,
double d) |
SimEvent |
waitDelay(java.lang.String n,
double d,
java.lang.Object... o)
Schedule an event with (optional) given parameters and a default priority after a delay from
the current simulation time.
|
SimEvent |
waitDelay(java.lang.String n,
double d,
Priority p,
java.lang.Object... o)
Schedule an event after a delay from the current
simulation time.
|
protected double initialTime
protected java.awt.geom.Point2D initialLocation
protected java.awt.geom.Point2D velocity
public static final java.lang.String MESSAGE
protected SurrogateTarget(java.awt.geom.Point2D point,
Mover leader)
point - Given initial locationleader - Given Mover representing the leaderpublic java.awt.geom.Point2D getLocation()
getLocation in interface Moveablepublic java.awt.geom.Point2D getVelocity()
getVelocity in interface Moveablepublic void accelerate(java.awt.geom.Point2D p)
Moveraccelerate in interface Moverp - given acceleration vectorpublic void accelerate(java.awt.geom.Point2D a,
double speed)
Moveraccelerate in interface Movera - given accelerationspeed - given speedpublic void doEndMove(Moveable mover)
Moverpublic void doStartMove(Moveable mover)
MoverdoStartMove in interface Movermover - Should be reference to this Mover.public double getMaxSpeed()
getMaxSpeed in interface Moverpublic MovementState getMovementState()
getMovementState in interface Moverpublic boolean isMoving()
public void magicMove(java.awt.geom.Point2D loc)
Moverpublic void move(java.awt.geom.Point2D vel)
Moverpublic void moveTo(java.awt.geom.Point2D d)
Moverpublic void moveTo(java.awt.geom.Point2D d,
double t)
Moverpublic java.lang.String paramString()
paramString in interface Moverpublic void pause()
Moverpublic void stop()
Moverpublic java.awt.geom.Point2D getAcceleration()
getAcceleration in interface Moveablepublic EventList getEventList()
getEventList in interface SimEventSchedulerEventList on which this scheduler will
schedule its events (and receive handleSimEvent() calls from).public int getEventListID()
getEventListID in interface SimEntitypublic Priority getPriority()
SimEventSchedulergetPriority in interface SimEventSchedulerpublic int getSerial()
getSerial in interface SimEventSchedulerpublic void handleSimEvent(SimEvent e)
SimEventSchedulerhandleSimEvent in interface SimEventSchedulere - The SimEvent to be handled.public void interrupt(java.lang.String n,
java.lang.Object... o)
SimEventSchedulerinterrupt in interface SimEventSchedulern - Name of event to cancelo - Parameters of the event to cancel (must be matched)public void interruptAll()
SimEventSchedulerinterruptAll in interface SimEventSchedulerpublic void interruptAll(java.lang.String n,
java.lang.Object... o)
SimEventSchedulerinterruptAll in interface SimEventSchedulern - Given event nameo - Given parameters to be matchedpublic boolean isPersistant()
isPersistant in interface ReRunnablepublic boolean isReRunnable()
isReRunnable in interface ReRunnablepublic void reset()
ReRunnablereset in interface ReRunnablepublic void setEventListID(int id)
setEventListID in interface SimEntitypublic void setPersistant(boolean p)
setPersistant in interface ReRunnablep - Given new value of persistentpublic void setPriority(Priority d)
SimEventSchedulersetPriority in interface SimEventSchedulerd - Priority of this objectpublic SimEvent waitDelay(java.lang.String n, double d)
public SimEvent waitDelay(java.lang.String n, double d, java.lang.Object... o)
SimEventSchedulerwaitDelay in interface SimEventSchedulern - The name of the scheduled event (prefixed by "do" for method name).d - The amount of time before the event is scheduledo - parameters, possibly emptypublic SimEvent waitDelay(java.lang.String n, double d, Priority p, java.lang.Object... o)
SimEventSchedulerwaitDelay in interface SimEventSchedulern - The name of the scheduled event (prefixed by "do" for method name).d - The amount of time before the event is scheduledp - The priority of this event (higher is better).o - The parameters passed to the scheduled event.SimEventpublic java.lang.String getName()
public void setName(java.lang.String n)
public void addSimEventListener(SimEventListener l)
SimEventSourceaddSimEventListener in interface SimEventSourcel - SimEventListener to addpublic SimEventListener[] getSimEventListeners()
SimEventSourcegetSimEventListeners in interface SimEventSourcepublic void notifyListeners(SimEvent e)
SimEventSourceTODO: should be eliminated or moved: This is not really part of the public contract for the listener pattern, but rather one way to implement that contract. It should be the object's responsibility to figure out when and how to notify its listeners, so no externally invokable trigger should be provided. NOTE: Un-deprecating this method.
notifyListeners in interface SimEventSourcee - the event to notify listeners of.public void removeSimEventListener(SimEventListener l)
SimEventSourceremoveSimEventListener in interface SimEventSourcel - SimEventListener to remove as listenerpublic void processSimEvent(SimEvent event)
SimEventListenerprocessSimEvent in interface SimEventListenerevent - The SimEvent to process.public void setProperty(java.lang.String name,
java.lang.Object value)
PropertyChangeSourcesetProperty in interface PropertyChangeSourcename - The name of the property to be setvalue - The new value of the propertypublic java.lang.Object getProperty(java.lang.String name)
PropertyChangeSourcegetProperty in interface PropertyChangeSourcename - The name of the property to be retrievedpublic java.lang.Object getProperty(java.lang.String name,
java.lang.Object defaultValue)
PropertyChangeSourcegetProperty in interface PropertyChangeSourcename - The name of the property to be retrieved.defaultValue - The default value -- returned if property's value cannot
be returned or is null.public void firePropertyChange(java.beans.PropertyChangeEvent event)
PropertyChangeSourcefirePropertyChange in interface PropertyChangeSourceevent - The event with all the information about what property has changed
and to what value.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeSourceaddPropertyChangeListener in interface PropertyChangeSourcelistener - The new listener to all my property changes.public void addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
PropertyChangeSourceaddPropertyChangeListener in interface PropertyChangeSourcepropertyName - The name of the property the listener is interested in.listener - The new listener to all my property changes.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
PropertyChangeSourceremovePropertyChangeListener in interface PropertyChangeSourcelistener - The listener that will stop listening to my property changes.public void removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
PropertyChangeSourceremovePropertyChangeListener in interface PropertyChangeSourcepropertyName - The name of the property to stop listening to.listener - The listener that will stop listening to my property changes.public java.beans.PropertyChangeListener[] getPropertyChangeListeners()
PropertyChangeSourcegetPropertyChangeListeners in interface PropertyChangeSourcepublic java.lang.String[] getAddedProperties()
getAddedProperties in interface PropertyChangeSourcepublic int compareTo(SimEntity other)
compareTo in interface java.lang.Comparable<SimEntity>public boolean isClearAddedPropertiesOnReset()
public void setClearAddedPropertiesOnReset(boolean b)
public void interrupt(java.lang.String eventName)
SimEventSchedulerinterrupt in interface SimEventSchedulereventName - Given event namepublic void interruptAll(java.lang.String eventName)
SimEventSchedulerinterruptAll in interface SimEventSchedulereventName - Given event namepublic void setMaxSpeed(double max)
throws MagicMoveException
MoversetMaxSpeed in interface Movermax - speed that this Mover should never exceed.MagicMoveException - if this Mover doesn't support "magic movespublic void setLocation(java.awt.geom.Point2D location)
throws MagicMoveException
MoversetLocation in interface Moverlocation - Given locationMagicMoveException - if Mover doesn't support magic movespublic void interruptAllWithArgs(java.lang.String eventName,
java.lang.Object parameter)
SimEventSchedulerinterruptAllWithArgs in interface SimEventSchedulereventName - name of eventparameter - parameter to matchpublic void interruptAllWithArgs(java.lang.Object parameter)
SimEventSchedulerinterruptAllWithArgs in interface SimEventSchedulerparameter - parameter to match