public class GTUTransceiver extends AbstractTransceiver
OTS publishes events about GTUs (vehicles) to IMB, e.g. to calculate statistics or emissions from the vehicles or to display them in the US animation.
When a GTU is created, a NEW message is sent to IMB to identify the GTU and its initial characteristics, including the lane on which it resides with its reference point, and the position on the lane. The CHANGE message is posted whenever a vehicle initiates a new OperationalPlan, which coincides with a MOVE Event in OTS. When a GTU is removed from the network, a DELETE event is posted. The GTU NEW messages are posted after the Network NEW, Node NEW, Link NEW, and Lane NEW messages are posted to ensure the Lane on which the GTU resides is known.
The longitudinal position of a GTU on a lane is the (projected) position on the center line of the lane, in meters. The zero-point is chosen at the start of the center line of the lane that has been provided in the Lane_GTU NEW message.
Variable | Type | Comments |
---|---|---|
timestamp | double | time of the event, in simulation time seconds |
gtuId | String | id of the GTU that has been added to the simulation |
position.x | double | x-coordinate of the gtu position in (gis) coordinates |
position.y | double | y-coordinate of the gtu position in (gis) coordinates |
position.z | double | z-coordinate of the gtu position in (gis) coordinates |
position.rotZ | double | angle in the x-y plane of the gtu |
networkId | String | Id of the Network where the gtu's reference point is |
linkId | String | id of the Link; unique within the Network |
laneId | String | id of the Lane, unique within the Link |
longitudinalPosition | double | gtu position on the center line of the lane, in meters |
length | double | length of the gtu, in meters |
width | double | width of the gtu, in meters |
baseColor.R | byte | R-component of the gtu's base color |
baseColor.G | byte | G-component of the gtu's base color |
baseColor.B | byte | B-component of the gtu's base color |
Variable | Type | Comments |
---|---|---|
timestamp | double | time of the event, in simulation time seconds |
gtuId | String | id of the vehicle that has a new position |
position.x | double | x-coordinate of the gtu position at the timestamp |
position.y | double | y-coordinate of the gtu position at the timestamp |
position.z | double | z-coordinate of the gtu position at the timestamp |
position.rotZ | double | angle in the x-y plane of the gtu |
networkId | String | Id of the Network where the gtu's reference point is |
linkId | String | id of the Link; unique within the Network |
laneId | String | id of the Lane, unique within the Link |
longitudinalPosition | double | gtu position on the center line of the lane, in meters |
speed | double | current speed of the gtu, in m/s |
acceleration | double | current acceleration of the gtu, in m/s2 |
turnIndicatorStatus | String | one of {NONE, LEFT, RIGHT, HAZARD, NOTPRESENT} |
brakingLights | boolean | braking lights on or off |
odometer | double | odometer reading of the GTU, in meters |
Variable | Type | Comments |
---|---|---|
timestamp | double | time of the event, in simulation time seconds |
gtuId | String | id of the GTU that that is removed from the simulation |
lastPosition.x | double | x-coordinate of the gtu position at removal |
lastPosition.y | double | y-coordinate of the gtu position at removal |
lastPosition.z | double | z-coordinate of the gtu position at removal |
position.rotZ | double | angle in the x-y plane of the gtu |
lastNetworkId | String | Id of the Network where the Link resides |
lastLinkId | String | id of the Link where the GTU was destroyed |
lastLaneId | String | id of the Lane in the Link where the GTU was destroyed |
lastLongitudinalPosition | double | gtu position on the center line of the lane, in meters |
odometer | double | final odometer reading of the GTU, in meters |
Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
GTUTransceiver.GTUTransformerChange
Transform the LaneBasedGTU.LANEBASED_MOVE_EVENT content to a corresponding IMB message.
|
Constructor and Description |
---|
GTUTransceiver(org.opentrafficsim.imb.connector.Connector connector,
org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator,
org.opentrafficsim.core.network.OTSNetwork network)
Construct a new GTUTransceiver.
|
Modifier and Type | Method and Description |
---|---|
void |
notify(nl.tudelft.simulation.event.EventInterface event) |
addIMBtoOTSChannel, addIMBtoOTSChannel, addOTSToIMBChannel, getConnector, getId, getSimulator, handleMessageFromIMB, removeOTSToIMBChannel, toString
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListener
public GTUTransceiver(org.opentrafficsim.imb.connector.Connector connector, org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface simulator, org.opentrafficsim.core.network.OTSNetwork network) throws org.opentrafficsim.imb.IMBException
connector
- Connector; the IMB connector through which this transceiver communicatessimulator
- OTSDEVSSimulatorInterface; the simulator to schedule the incoming notifications onnetwork
- OTSNetwork; the OTS network on which GTUs are registeredorg.opentrafficsim.imb.IMBException
- when the registration of one of the channels failsNullPointerException
- in case one of the arguments is null.public void notify(nl.tudelft.simulation.event.EventInterface event) throws RemoteException
notify
in interface nl.tudelft.simulation.event.EventListenerInterface
notify
in class AbstractTransceiver
RemoteException
Copyright © 2014–2016 Delft University of Technology. All rights reserved.