Class NodeTransceiver
java.lang.Object
org.djutils.event.EventProducer
org.opentrafficsim.imb.transceiver.AbstractTransceiver
org.opentrafficsim.imb.transceiver.urbanstrategy.NodeTransceiver
- All Implemented Interfaces:
Serializable,EventListener,EventListenerInterface,EventProducerInterface,Identifiable,org.opentrafficsim.imb.transceiver.EventTransceiver,org.opentrafficsim.imb.transceiver.Transceiver
public class NodeTransceiver extends AbstractTransceiver
OTS publishes events about the Nodes to IMB to be able to identify the nodes in the network.
At the start of the OTS simulation, or when a Node is added later, a NEW message is sent to IMB for each node to identify the node id. No CHANGE messages are posted. When a Node is removed from the network, a DELETE event is posted. The Node NEW messages are posted after the Network NEW message is posted.
At the start of the OTS simulation, or when a Node is added later, a NEW message is sent to IMB for each node to identify the node id. No CHANGE messages are posted. When a Node is removed from the network, a DELETE event is posted. The Node NEW messages are posted after the Network NEW message is posted.
NEW
| Variable | Type | Comments |
|---|---|---|
| timestamp | double | time of the event, in simulation time seconds |
| networkId | String | Id of the Network where the Node resides |
| nodeId | String | id of the Node; unique within the Network |
| coordinate.x | double | x-coordinate of the Node |
| coordinate.y | double | y-coordinate of the Node |
| coordinate.z | double | z-coordinate of the Node |
CHANGE
Not sent
DELETE
| Variable | Type | Comments |
|---|---|---|
| timestamp | double | time of the event, in simulation time seconds |
| networkId | String | Id of the Network where the Node resides |
| nodeId | String | id of the Node that is removed from the Network |
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 NodeTransceiver(org.opentrafficsim.imb.connector.Connector connector, DEVSSimulatorInterface.TimeDoubleUnit simulator, OTSNetwork network)Construct a new NodeTransceiver. -
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
-
NodeTransceiver
public NodeTransceiver(org.opentrafficsim.imb.connector.Connector connector, DEVSSimulatorInterface.TimeDoubleUnit simulator, OTSNetwork network) throws org.opentrafficsim.imb.IMBExceptionConstruct a new NodeTransceiver.- 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 Nodes 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
-