public class CookieCutterSensor extends SimEntityBase implements Sensor
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<Moveable> |
contacts
The Contacts currently being tracked by this Sensor.
|
protected java.awt.geom.Ellipse2D |
footprint
The circular coverage area for this Sensor.
|
protected java.awt.geom.AffineTransform |
locationTransform |
protected double |
maxRange
The range of this Sensor.
|
protected Mover |
mover
The Mover on which this Sensor resides.
|
eventList, propertyDEFAULT_ENTITY_NAME, DEFAULT_EVENT_NAME, DEFAULT_PRIORITY, EVENT_METHOD_PREFIX, NL| Constructor and Description |
|---|
CookieCutterSensor(double maxRange)
Creates a new CookieCutterSensor not associated with a Mover.
|
CookieCutterSensor(double maxRange,
Mover mover)
Creates a new CookieCutterSensor.
|
CookieCutterSensor(Mover mover,
double maxRange)
Creates a new CookieCutterSensor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
doDetection(Moveable contact)
Adds the contact to the list of currently sensed contacts.
|
void |
doEndMove(Mover mover)
Schedules EndMove for this Sensor.
|
void |
doStartMove(Mover mover)
Schedules StartMove for this sensor
|
void |
doUndetection(Moveable contact)
Removes the given contact from the contacts list.
|
java.awt.geom.Point2D |
getAcceleration()
Returns the acceleration vector for this Sensor.
|
java.util.Set<Moveable> |
getContacts()
Returns this Set of contacts currently held by this Sensor.
|
java.awt.Shape |
getFootprint()
Returns the detection area for this Sensor.
|
java.awt.geom.Point2D |
getLocation()
The current location of this Sensor.
|
double |
getMaxRange()
Returns the radius of detection for this Sensor.
|
Mover |
getMover()
The Mover on which this Sensor is located.
|
java.awt.geom.Point2D |
getVelocity()
Returns the velocity of this Sensor.
|
boolean |
isInRangeOf(java.awt.geom.Point2D point)
Determine if the given point is inside the detection area for
this Sensor.
|
void |
propertyChange(java.beans.PropertyChangeEvent e)
If from this Sensor's mover, re-broadcast the event.
|
void |
reset()
Clears all pending events for this Sensor and clears the contact list.
|
void |
setMaxRange(double r) |
void |
setMover(Mover mover)
Places this Sensor on the given Mover.
|
java.lang.String |
toString()
Returns a String containing the range of this Sensor and the information on the Mover
for this Sensor.
|
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, setPropertyprotected Mover mover
protected java.awt.geom.Ellipse2D footprint
protected java.awt.geom.AffineTransform locationTransform
protected java.util.Set<Moveable> contacts
protected double maxRange
public CookieCutterSensor(double maxRange)
maxRange - Radius of "cookie"public CookieCutterSensor(double maxRange,
Mover mover)
maxRange - Radius of "cookie"mover - The Mover this sensor delegates its position topublic CookieCutterSensor(Mover mover, double maxRange)
maxRange - Radius of "cookie"mover - The Mover this sensor delegates its position topublic void doDetection(Moveable contact)
doDetection in interface Sensorcontact - Mover that is passed by the Mediatorpublic void doUndetection(Moveable contact)
doUndetection in interface Sensorcontact - The contact that was lostpublic java.awt.geom.Point2D getVelocity()
getVelocity in interface Moveablepublic double getMaxRange()
getMaxRange in interface Sensorpublic java.awt.Shape getFootprint()
getFootprint in interface Sensorpublic java.awt.geom.Point2D getAcceleration()
getAcceleration in interface Moveablepublic void doEndMove(Mover mover)
public void doStartMove(Mover mover)
doStartMove in interface Sensormover - Mover this Sensor is onpublic java.awt.geom.Point2D getLocation()
getLocation in interface Moveablepublic Mover getMover()
public void setMover(Mover mover)
public void reset()
reset in interface ReRunnablereset in class BasicSimEntitypublic boolean isInRangeOf(java.awt.geom.Point2D point)
isInRangeOf in interface Sensorpoint - Point to testpublic java.lang.String toString()
toString in class BasicSimEntitypublic void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange in interface java.beans.PropertyChangeListenere - Heard PropertyChangeEventpublic java.util.Set<Moveable> getContacts()
getContacts in interface Sensorpublic void setMaxRange(double r)
setMaxRange in interface Sensor