public class OTSAnimator extends DEVSRealTimeClock.TimeDoubleUnit implements OTSAnimatorInterface, Serializable
Copyright (c) 2013-2019 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
DEVSRealTimeClock.CalendarDouble, DEVSRealTimeClock.CalendarFloat, DEVSRealTimeClock.CalendarLong, DEVSRealTimeClock.TimeDouble, DEVSRealTimeClock.TimeDoubleUnit, DEVSRealTimeClock.TimeFloat, DEVSRealTimeClock.TimeFloatUnit, DEVSRealTimeClock.TimeLong
DEVSSimulatorInterface.CalendarDouble, DEVSSimulatorInterface.CalendarFloat, DEVSSimulatorInterface.CalendarLong, DEVSSimulatorInterface.TimeDouble, DEVSSimulatorInterface.TimeDoubleUnit, DEVSSimulatorInterface.TimeFloat, DEVSSimulatorInterface.TimeFloatUnit, DEVSSimulatorInterface.TimeLong
AnimatorInterface.AnimationThread
BACKLOG_EVENT, CHANGE_SPEED_FACTOR_EVENT
eventList
replication, running, semaphore, simulatorTime, worker
listeners
EVENTLIST_CHANGED_EVENT
END_REPLICATION_EVENT, START_EVENT, START_REPLICATION_EVENT, STEP_EVENT, STOP_EVENT, TIME_CHANGED_EVENT, WARMUP_EVENT
FIRST_POSITION, LAST_POSITION
ANIMATION_DELAY_CHANGED_EVENT, DEFAULT_ANIMATION_DELAY, UPDATE_ANIMATION_EVENT
Constructor and Description |
---|
OTSAnimator()
Construct an OTSAnimator.
|
Modifier and Type | Method and Description |
---|---|
OTSReplication |
getReplication() |
void |
initialize(Time startTime,
Duration warmupPeriod,
Duration runLength,
OTSModelInterface model)
Initialize a simulation engine without animation; the easy way.
|
void |
initialize(Time startTime,
Duration warmupPeriod,
Duration runLength,
OTSModelInterface model,
int replicationnr)
Initialize a simulation engine without animation and prescribed replication number; the easy way.
|
SimEvent<SimTimeDoubleUnit> |
scheduleEvent(Time executionTime,
short priority,
Object source,
Object target,
String method,
Object[] args)
Construct and schedule a SimEvent using a Time to specify the execution time.
|
String |
toString() |
relativeMillis
getSpeedFactor, getUpdateMsec, isCatchup, run, setCatchup, setSpeedFactor, setSpeedFactor, setUpdateMsec
getAnimationDelay, setAnimationDelay, updateAnimation
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, step
cleanUp, getSimTime, getSimulatorTime, isRunning, start, start, step, stop, stop
addListener, addListener, addListener, addListener, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, fireTimedEvent, removeAllListeners, removeAllListeners, removeListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
cancelEvent, getEventList, isPauseOnError, runUpTo, runUpToAndIncluding, scheduleEvent, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventNow, scheduleEventNow, scheduleEventNow, scheduleEventNow, scheduleEventRel, scheduleEventRel, scheduleEventRel, scheduleEventRel, setEventList, setPauseOnError
endReplication, getSimTime, getSimulatorTime, initialize, isRunning, start, start, step, step, stop, stop
addListener, addListener, addListener, addListener, removeListener
getAnimationDelay, setAnimationDelay, updateAnimation
public void initialize(Time startTime, Duration warmupPeriod, Duration runLength, OTSModelInterface model) throws SimRuntimeException, NamingException
initialize
in interface OTSSimulatorInterface
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 executeSimRuntimeException
- when e.g., warmupPeriod is larger than runLengthNamingException
- when the context for the replication cannot be createdpublic void initialize(Time startTime, Duration warmupPeriod, Duration runLength, OTSModelInterface model, int replicationnr) throws SimRuntimeException, NamingException
initialize
in interface OTSSimulatorInterface
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 numberSimRuntimeException
- when e.g., warmupPeriod is larger than runLengthNamingException
- when context for the animation cannot be createdpublic final SimEvent<SimTimeDoubleUnit> scheduleEvent(Time executionTime, short priority, Object source, Object target, String method, Object[] args) throws SimRuntimeException
scheduleEvent
in interface OTSSimulatorInterface
executionTime
- Time; the time at which the event must happenpriority
- short; should be between SimEventInterface.MAX_PRIORITY and
SimEventInterface.MIN_PRIORITY; most normal events should use
SimEventInterface.NORMAL_PRIORITYsource
- Object; the object that creates/schedules the eventtarget
- Object; the object that must execute the eventmethod
- String; the name of the method of target
that must execute the eventargs
- Object[]; the arguments of the method
that must execute the eventSimRuntimeException
- when the executionTime
is in the pastpublic final OTSReplication getReplication()
getReplication
in interface SimulatorInterface<Time,Duration,SimTimeDoubleUnit>
getReplication
in interface OTSSimulatorInterface
getReplication
in class DEVSRealTimeClock.TimeDoubleUnit
Copyright © 2014–2019 Delft University of Technology. All rights reserved.