Class DestinationSensor
- java.lang.Object
-
- org.djutils.event.EventProducer
-
- org.opentrafficsim.core.object.StaticObject
-
- org.opentrafficsim.road.network.lane.object.AbstractLaneBasedObject
-
- org.opentrafficsim.road.network.lane.object.sensor.AbstractSensor
-
- org.opentrafficsim.road.network.lane.object.sensor.DestinationSensor
-
- All Implemented Interfaces:
Serializable,Comparable<SingleSensor>,Locatable,EventProducerInterface,Identifiable,Drawable,Compatible,ObjectInterface,LaneBasedObject,Sensor,SingleSensor
public class DestinationSensor extends AbstractSensor
A DestinationSensor is a sensor that deletes a GTU that has the node it will pass after this sensor as its destination.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
$LastChangedDate: 2015-08-12 16:37:45 +0200 (Wed, 12 Aug 2015) $, @version $Revision: 1240 $, by $Author: averbraeck $, initial version an 30, 2015
All rights reserved.
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.djutils.event.EventProducer
eventProducerImpl
-
Fields inherited from interface org.opentrafficsim.core.compatibility.Compatible
EVERYTHING, MINUS, PLUS
-
Fields inherited from interface org.djutils.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION
-
Fields inherited from interface org.opentrafficsim.road.network.lane.object.sensor.SingleSensor
DEFAULT_SENSOR_ELEVATION, SENSOR_TRIGGER_EVENT
-
-
Constructor Summary
Constructors Constructor Description DestinationSensor(Lane lane, Length position, Compatible compatible, DEVSSimulatorInterface.TimeDoubleUnit simulator)DestinationSensor(Lane lane, Length position, GtuDirectionality gtuDirectionality, DEVSSimulatorInterface.TimeDoubleUnit simulator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DestinationSensorclone(CrossSectionElement newCSE, SimulatorInterface.TimeDoubleUnit newSimulator)Clone the LaneBasedObject for e.g., copying a network.StringtoString()voidtriggerResponse(LaneBasedGtu gtu)Implementation of the response to a trigger of this sensor by a GTU.-
Methods inherited from class org.opentrafficsim.road.network.lane.object.sensor.AbstractSensor
compareTo, equals, getDetectedGTUTypes, getPositionType, getSimulator, hashCode, isCompatible, makeGeometry, trigger
-
Methods inherited from class org.opentrafficsim.road.network.lane.object.AbstractLaneBasedObject
clone, getDirection, getFullId, getLane, getLocation, getLongitudinalPosition, init
-
Methods inherited from class org.opentrafficsim.core.object.StaticObject
create, create, getBounds, getGeometry, getId, getMaximumRelativeHeight, getMinimumRelativeHeight, getSourceId
-
Methods inherited from class org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, fireUnverifiedTimedEvent, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListener
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.djutils.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypesWithListeners, getSourceId, hasListeners, numberOfListeners, removeListener
-
Methods inherited from interface org.opentrafficsim.base.Identifiable
getId
-
Methods inherited from interface org.opentrafficsim.road.network.lane.object.LaneBasedObject
getBounds, getDirection, getLane, getLocation, getLongitudinalPosition
-
Methods inherited from interface org.opentrafficsim.core.object.ObjectInterface
getFullId, getGeometry, getMaximumRelativeHeight, getMinimumRelativeHeight
-
-
-
-
Constructor Detail
-
DestinationSensor
public DestinationSensor(Lane lane, Length position, GtuDirectionality gtuDirectionality, DEVSSimulatorInterface.TimeDoubleUnit simulator) throws NetworkException
- Parameters:
lane- Lane; the lane that triggers the deletion of the GTU.position- Length; the position of the sensorgtuDirectionality- GtuDirectionality; GTU directionalitysimulator- DEVSSimulatorInterface.TimeDoubleUnit; the simulator to enable animation.- Throws:
NetworkException- when the position on the lane is out of bounds w.r.t. the center line of the lane
-
DestinationSensor
public DestinationSensor(Lane lane, Length position, Compatible compatible, DEVSSimulatorInterface.TimeDoubleUnit simulator) throws NetworkException
- Parameters:
lane- Lane; the lane that triggers the deletion of the GTU.position- Length; the position of the sensorcompatible- Compatible; compatible GTU type and directionsimulator- DEVSSimulatorInterface.TimeDoubleUnit; the simulator to enable animation.- Throws:
NetworkException- when the position on the lane is out of bounds w.r.t. the center line of the lane
-
-
Method Detail
-
triggerResponse
public final void triggerResponse(LaneBasedGtu gtu)
Implementation of the response to a trigger of this sensor by a GTU.- Specified by:
triggerResponsein classAbstractSensor- Parameters:
gtu- LaneBasedGTU; the lane based GTU that triggered this sensor.
-
toString
public final String toString()
- Overrides:
toStringin classAbstractSensor
-
clone
public DestinationSensor clone(CrossSectionElement newCSE, SimulatorInterface.TimeDoubleUnit newSimulator) throws NetworkException
Clone the LaneBasedObject for e.g., copying a network.- Specified by:
clonein classAbstractSensor- Parameters:
newCSE- CrossSectionElement; the new cross section element to which the clone belongsnewSimulator- SimulatorInterface.TimeDoubleUnit; the new simulator for this network- Returns:
- AbstractLaneBasedObject; a clone of this object
- Throws:
NetworkException- in case the cloning fails
-
-