Class SensorGTUTransceiver
java.lang.Object
org.djutils.event.EventProducer
org.opentrafficsim.imb.transceiver.AbstractTransceiver
org.opentrafficsim.imb.transceiver.urbanstrategy.SensorGTUTransceiver
- All Implemented Interfaces:
Serializable,EventListener,EventListenerInterface,EventProducerInterface,Identifiable,org.opentrafficsim.imb.transceiver.EventTransceiver,org.opentrafficsim.imb.transceiver.Transceiver
public class SensorGTUTransceiver extends AbstractTransceiver
OTS publishes events about sensor triggers to IMB, e.g. to show that a vehicle has triggered a sensor for a traffic
light.
At the start of the OTS simulation, or when a sensor is added later, a NEW message is sent to IMB to identify the sensor, the lane on which it resides, and the position on the lane. The CHANGE message is posted whenever a vehicle triggers the sensor. When a Sensor is removed from the network, a DELETE event is posted. The Sensor NEW messages are posted after the Network NEW, Node NEW, Link NEW, and Lane NEW messages are posted.
At the start of the OTS simulation, or when a sensor is added later, a NEW message is sent to IMB to identify the sensor, the lane on which it resides, and the position on the lane. The CHANGE message is posted whenever a vehicle triggers the sensor. When a Sensor is removed from the network, a DELETE event is posted. The Sensor NEW messages are posted after the Network NEW, Node NEW, Link NEW, and Lane NEW messages are posted.
NEW
| Variable | Type | Comments |
|---|---|---|
| timestamp | double | time of the event, in simulation time seconds |
| networkId | String | Id of the Network where the Link resides |
| linkId | String | id of the Link; unique within the Network |
| laneId | String | id of the Lane, unique within the Link |
| sensorId | String | id of the Sensor, unique within the Lane |
| longitudinalPosition | double | position on the center line of the lane, in meters |
| length | double | length of the sensor, in meters |
| sensorPosition.x | double | x-coordinate of the sensor position in (gis) coordinates |
| sensorPosition.y | double | y-coordinate of the sensor position in (gis) coordinates |
| sensorPosition.z | double | z-coordinate of the sensor position in (gis) coordinates |
| triggerPosition | String | Relative position of the vehicle that triggers this sensor. One of {FRONT, REAR, REFERENCE, CONTOUR, CENTER, DRIVER} |
CHANGE
| Variable | Type | Comments |
|---|---|---|
| timestamp | double | time of the event, in simulation time seconds |
| networkId | String | Id of the Network where the Lane resides |
| linkId | String | id of the Link to which the lane belongs |
| laneId | String | id of the Lane, unique within the Link |
| sensorId | String | id of the Sensor, unique within the Lane |
| gtuId | String | id of the vehicle that triggers the sensor |
| speed | double | speed of the vehicle that triggers the sensor, in m/s |
| triggerPosition | String | Relative position of the vehicle that triggers this sensor. One of {FRONT, REAR, REFERENCE, CONTOUR, CENTER, DRIVER} |
DELETE
| Variable | Type | Comments |
|---|---|---|
| timestamp | double | time of the event, in simulation time seconds |
| networkId | String | Id of the Network where the Link resides |
| linkId | String | id of the Link in the Network |
| laneId | String | id of the Lane in the Link |
| sensorId | String | id of the Sensor that is removed from the Lane |
Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version Sep 13, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from interface org.djutils.event.EventProducerInterface
FIRST_POSITION, LAST_POSITION -
Constructor Summary
Constructors Constructor Description SensorGTUTransceiver(org.opentrafficsim.imb.connector.Connector connector, DEVSSimulatorInterface.TimeDoubleUnit simulator, OTSNetwork network)Construct a new SensorGTUTransceiver. -
Method Summary
Modifier and Type Method Description SerializablegetSourceId()voidnotify(EventInterface event)Methods inherited from class org.opentrafficsim.imb.transceiver.AbstractTransceiver
addIMBtoOTSChannel, addIMBtoOTSChannel, addOTSToIMBChannel, getConnector, getId, getSimulator, handleMessageFromIMB, removeOTSToIMBChannel, toStringMethods inherited from class org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, getEventTypesWithListeners, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djutils.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypesWithListeners, hasListeners, numberOfListeners, removeListener
-
Constructor Details
-
SensorGTUTransceiver
public SensorGTUTransceiver(org.opentrafficsim.imb.connector.Connector connector, DEVSSimulatorInterface.TimeDoubleUnit simulator, OTSNetwork network) throws org.opentrafficsim.imb.IMBExceptionConstruct a new SensorGTUTransceiver.- Parameters:
connector- Connector; the IMB connector through which this transceiver communicatessimulator- DEVSSimulatorInterface.TimeDoubleUnit; the simulator to schedule the incoming notifications onnetwork- OTSNetwork; the OTS network on which Links for Lanes are registered- Throws:
org.opentrafficsim.imb.IMBException- when the registration of one of the channels failsNullPointerException- in case one of the arguments is null.
-
-
Method Details
-
notify
- Specified by:
notifyin interfaceEventListenerInterface- Overrides:
notifyin classAbstractTransceiver- Throws:
RemoteException
-
getSourceId
- Specified by:
getSourceIdin interfaceEventProducerInterface- Specified by:
getSourceIdin classEventProducer
-