Class SimulatorTransceiver
java.lang.Object
org.djutils.event.EventProducer
org.opentrafficsim.imb.transceiver.AbstractTransceiver
org.opentrafficsim.imb.transceiver.urbanstrategy.SimulatorTransceiver
- All Implemented Interfaces:
Serializable,EventListener,EventListenerInterface,EventProducerInterface,Identifiable,org.opentrafficsim.imb.transceiver.EventTransceiver,org.opentrafficsim.imb.transceiver.Transceiver
public class SimulatorTransceiver extends AbstractTransceiver
The SimulatorTranseiver sends and listens to start, stop and change speed messages. The SimulatorTransceiver publishes the
following information on the IMB bus:
- SimulatorInterface.START_EVENT when the simulator starts executing.
- SimulatorInterface.STOP_EVENT when the simulator stops executing.
- DEVSRealTimeClock.CHANGE_SPEED_FACTOR_EVENT when the simulator speed changes. Note that the simulation speed values are limited to the following: {0.1, 0.2, 0.5, 1.0, 2.0, 5.0, 10.0, 20.0, 50.0, 100.0, 200.0, 500.0, 1000.0, Double.MAX_DOUBLE}
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.
- 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 SimulatorTransceiver(org.opentrafficsim.imb.connector.Connector connector, DEVSSimulatorInterface.TimeDoubleUnit simulator)Construct a new SimulatorTransceiver. -
Method Summary
Modifier and Type Method Description SerializablegetSourceId()Methods inherited from class org.opentrafficsim.imb.transceiver.AbstractTransceiver
addIMBtoOTSChannel, addIMBtoOTSChannel, addOTSToIMBChannel, getConnector, getId, getSimulator, handleMessageFromIMB, notify, 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
-
SimulatorTransceiver
public SimulatorTransceiver(org.opentrafficsim.imb.connector.Connector connector, DEVSSimulatorInterface.TimeDoubleUnit simulator) throws org.opentrafficsim.imb.IMBExceptionConstruct a new SimulatorTransceiver.- Parameters:
connector- Connector; the IMB connector through which this transceiver communicatessimulator- DEVSSimulatorInterface.TimeDoubleUnit; the simulator to schedule the incoming notifications on- Throws:
org.opentrafficsim.imb.IMBException- when the registration of one of the channels failsNullPointerException- in case one of the arguments is null.
-
-
Method Details
-
getSourceId
- Specified by:
getSourceIdin interfaceEventProducerInterface- Specified by:
getSourceIdin classEventProducer
-