Package org.opentrafficsim.core.dsol
Class OTSLoggingAnimator
java.lang.Object
org.djutils.event.EventProducer
nl.tudelft.simulation.dsol.simulators.Simulator<A,R,T>
nl.tudelft.simulation.dsol.simulators.DEVSSimulator<A,R,T>
nl.tudelft.simulation.dsol.simulators.DEVSAnimator<A,R,T>
nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock<Time,Duration,SimTimeDoubleUnit>
nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock.TimeDoubleUnit
org.opentrafficsim.core.dsol.OTSAnimator
org.opentrafficsim.core.dsol.OTSLoggingAnimator
- All Implemented Interfaces:
Serializable,Runnable,Remote,AnimatorInterface,DEVSSimulatorInterface<Time,Duration,SimTimeDoubleUnit>,DEVSSimulatorInterface.TimeDoubleUnit,SimulatorInterface<Time,Duration,SimTimeDoubleUnit>,SimulatorInterface.TimeDoubleUnit,EventProducerInterface,OTSAnimatorInterface,OTSSimulatorInterface
public class OTSLoggingAnimator extends OTSAnimator
Construct a DSOL DEVSRealTimeClock the easy way.
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.
$LastChangedDate: 2018-10-30 14:03:57 +0100 (Tue, 30 Oct 2018) $, @version $Revision: 4727 $, by $Author: pknoppers $,
initial version 11 mei 2015
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock
DEVSRealTimeClock.CalendarDouble, DEVSRealTimeClock.CalendarFloat, DEVSRealTimeClock.CalendarLong, DEVSRealTimeClock.TimeDouble, DEVSRealTimeClock.TimeDoubleUnit, DEVSRealTimeClock.TimeFloat, DEVSRealTimeClock.TimeFloatUnit, DEVSRealTimeClock.TimeLongNested classes/interfaces inherited from interface nl.tudelft.simulation.dsol.simulators.AnimatorInterface
AnimatorInterface.AnimationThreadNested classes/interfaces inherited from interface nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface
DEVSSimulatorInterface.CalendarDouble, DEVSSimulatorInterface.CalendarFloat, DEVSSimulatorInterface.CalendarLong, DEVSSimulatorInterface.TimeDouble, DEVSSimulatorInterface.TimeDoubleUnit, DEVSSimulatorInterface.TimeFloat, DEVSSimulatorInterface.TimeFloatUnit, DEVSSimulatorInterface.TimeLongNested classes/interfaces inherited from interface nl.tudelft.simulation.dsol.simulators.SimulatorInterface
SimulatorInterface.CalendarDouble, SimulatorInterface.CalendarFloat, SimulatorInterface.CalendarLong, SimulatorInterface.TimeDouble, SimulatorInterface.TimeDoubleUnit, SimulatorInterface.TimeFloat, SimulatorInterface.TimeFloatUnit, SimulatorInterface.TimeLong -
Field Summary
Fields inherited from class nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock
BACKLOG_EVENT, CHANGE_SPEED_FACTOR_EVENTFields inherited from class nl.tudelft.simulation.dsol.simulators.Simulator
replication, running, semaphore, simulatorTime, workerFields inherited from interface nl.tudelft.simulation.dsol.simulators.AnimatorInterface
ANIMATION_DELAY_CHANGED_EVENT, DEFAULT_ANIMATION_DELAY, UPDATE_ANIMATION_EVENTFields inherited from interface nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface
EVENTLIST_CHANGED_EVENTFields inherited from interface org.djutils.event.EventProducerInterface
FIRST_POSITION, LAST_POSITIONFields inherited from interface nl.tudelft.simulation.dsol.simulators.SimulatorInterface
END_REPLICATION_EVENT, START_EVENT, START_REPLICATION_EVENT, STEP_EVENT, STOP_EVENT, TIME_CHANGED_EVENT, WARMUP_EVENT -
Constructor Summary
Constructors Constructor Description OTSLoggingAnimator(String path, Serializable simulatorId)Construct an OTSAnimator. -
Method Summary
Modifier and Type Method Description voidinitialize(Time startTime, Duration warmupPeriod, Duration runLength, OTSModelInterface model)Initialize a simulation engine without animation; the easy way.voidinitialize(Time startTime, Duration warmupPeriod, Duration runLength, OTSModelInterface model, int replicationnr)Initialize a simulation engine without animation and prescribed replication number; the easy way.voidinitialize(Time startTime, Duration warmupPeriod, Duration runLength, OTSModelInterface model, Map<String,StreamInterface> streams)Initialize a simulation engine without animation; the easy way.voidrun()StringtoString()Methods inherited from class nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock.TimeDoubleUnit
simulatorTimeForWallClockMillisMethods inherited from class nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock
getSpeedFactor, getUpdateMsec, isAnimation, isCatchup, setAnimation, setCatchup, setSpeedFactor, setSpeedFactor, setUpdateMsecMethods inherited from class nl.tudelft.simulation.dsol.simulators.DEVSAnimator
getAnimationDelay, setAnimationDelay, updateAnimationMethods inherited from class nl.tudelft.simulation.dsol.simulators.DEVSSimulator
autoPauseSimulator, cancelEvent, endReplication, getEventList, initialize, isPauseOnError, runUpTo, runUpToAndIncluding, scheduleEvent, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventNow, scheduleEventNow, scheduleEventNow, scheduleEventNow, scheduleEventRel, scheduleEventRel, scheduleEventRel, scheduleEventRel, setEventList, setPauseOnError, stepMethods inherited from class nl.tudelft.simulation.dsol.simulators.Simulator
cleanUp, getLogger, getSimTime, getSimulatorTime, getSourceId, isRunning, start, start, step, stop, stopMethods inherited from class org.djutils.event.EventProducer
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, getEventTypesWithListeners, getListenerReferences, hasListeners, numberOfListeners, removeAllListeners, removeAllListeners, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface nl.tudelft.simulation.dsol.simulators.AnimatorInterface
getAnimationDelay, setAnimationDelay, updateAnimationMethods inherited from interface nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface
cancelEvent, getEventList, isPauseOnError, runUpTo, runUpToAndIncluding, scheduleEvent, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventNow, scheduleEventNow, scheduleEventNow, scheduleEventNow, scheduleEventRel, scheduleEventRel, scheduleEventRel, scheduleEventRel, setEventList, setPauseOnErrorMethods inherited from interface org.djutils.event.EventProducerInterface
addListener, addListener, addListener, addListener, getEventTypesWithListeners, hasListeners, numberOfListeners, removeListenerMethods inherited from interface nl.tudelft.simulation.dsol.simulators.SimulatorInterface
endReplication, getLogger, getSimTime, getSimulatorTime, getSourceId, initialize, isRunning, start, start, step, step, stop, stop
-
Constructor Details
-
OTSLoggingAnimator
Construct an OTSAnimator.- Parameters:
path- path for loggingsimulatorId- the id of the simulator to use in remote communication
-
-
Method Details
-
initialize
public void initialize(Time startTime, Duration warmupPeriod, Duration runLength, OTSModelInterface model) throws SimRuntimeException, NamingExceptionInitialize a simulation engine without animation; the easy way. PauseOnError is set to true;- Specified by:
initializein interfaceOTSSimulatorInterface- Overrides:
initializein classOTSAnimator- Parameters:
startTime- Time; the start time of the simulationwarmupPeriod- Duration; the warm up period of the simulation (use new Duration(0, SECOND) if you don't know what this is)runLength- Duration; the duration of the simulationmodel- OTSModelInterface; the simulation to execute- Throws:
SimRuntimeException- when e.g., warmupPeriod is larger than runLengthNamingException- when the context for the replication cannot be created
-
initialize
public void initialize(Time startTime, Duration warmupPeriod, Duration runLength, OTSModelInterface model, Map<String,StreamInterface> streams) throws SimRuntimeException, NamingExceptionInitialize a simulation engine without animation; the easy way. PauseOnError is set to true;- Overrides:
initializein classOTSAnimator- Parameters:
startTime- Time; the start time of the simulationwarmupPeriod- Duration; the warm up period of the simulation (use new Duration(0, SECOND) if you don't know what this is)runLength- Duration; the duration of the simulationmodel- OTSModelInterface; the simulation to executestreams- Map<String, StreamInterface>; streams- Throws:
SimRuntimeException- when e.g., warmupPeriod is larger than runLengthNamingException- when the context for the replication cannot be created
-
initialize
public void initialize(Time startTime, Duration warmupPeriod, Duration runLength, OTSModelInterface model, int replicationnr) throws SimRuntimeException, NamingExceptionInitialize a simulation engine without animation and prescribed replication number; the easy way. PauseOnError is set to true;- Specified by:
initializein interfaceOTSSimulatorInterface- Overrides:
initializein classOTSAnimator- Parameters:
startTime- Time; the start time of the simulationwarmupPeriod- Duration; the warm up period of the simulation (use new Duration(0, SECOND) if you don't know what this is)runLength- Duration; the duration of the simulationmodel- OTSModelInterface; the simulation to executereplicationnr- int; the replication number- Throws:
SimRuntimeException- when e.g., warmupPeriod is larger than runLengthNamingException- when context for the animation cannot be created
-
toString
- Overrides:
toStringin classOTSAnimator
-
run
public void run()- Specified by:
runin interfaceRunnable- Overrides:
runin classDEVSRealTimeClock<Time,Duration,SimTimeDoubleUnit>
-