public class SimpleAnimator extends OTSDEVSRealTimeClock implements SimpleSimulatorInterface
Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
$LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, @version $Revision: 1401 $, by $Author: averbraeck $,
initial version 11 mei 2015
nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock.CalendarDouble, nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock.CalendarFloat, nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock.CalendarLong, nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock.TimeDouble, nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock.TimeDoubleUnit, nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock.TimeFloat, nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock.TimeFloatUnit, nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock.TimeLong, nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock.TimeLongUnit
nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.CalendarDouble, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.CalendarFloat, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.CalendarLong, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.TimeDouble, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.TimeDoubleUnit, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.TimeFloat, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.TimeFloatUnit, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.TimeLong, nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface.TimeLongUnit
org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Acceleration, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.AnglePlane, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.AngleSlope, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.AngleSolid, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Area, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Density, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Dimensionless, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.ElectricalCharge, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.ElectricalCurrent, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.ElectricalPotential, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.ElectricalResistance, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Energy, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.FlowMass, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.FlowVolume, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Force, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Frequency, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Length, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.LinearDensity, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Mass, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Power, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Pressure, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Speed, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Temperature, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Time, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Torque, org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Volume
replication, running, semaphore, simulatorTime, worker
EVENTLIST_CHANGED_EVENT
END_OF_REPLICATION_EVENT, START_EVENT, START_REPLICATION_EVENT, STEP_EVENT, STOP_EVENT, TIME_CHANGED_EVENT, WARMUP_EVENT
FIRST_POSITION, LAST_POSITION
ABAMPERE, ABCOULOMB, ABVOLT, ACRE, AMPERE, ARCMINUTE, ARCSECOND, ARE, ATMOSPHERE_STANDARD, ATMOSPHERE_TECHNICAL, ATOMIC_UNIT, BAR, BARYE, BTU_ISO, BTU_IT, CALORIE_IT, CENTESIMAL_ARCMINUTE, CENTESIMAL_ARCSECOND, CENTIMETER, CENTIMETER_MERCURY, COULOMB, CUBIC_CENTIMETER, CUBIC_DECIMETER, CUBIC_FEET_PER_MINUTE, CUBIC_FEET_PER_SECOND, CUBIC_FOOT, CUBIC_INCH, CUBIC_INCH_PER_MINUTE, CUBIC_INCH_PER_SECOND, CUBIC_KM, CUBIC_METER, CUBIC_METER_PER_DAY, CUBIC_METER_PER_HOUR, CUBIC_METER_PER_MINUTE, CUBIC_METER_PER_SECOND, CUBIC_MILE, CUBIC_YARD, DALTON, DAY, DECIMETER, DEG, DEGREE, DEGREE_CELSIUS, DEGREE_FAHRENHEIT, DEGREE_RANKINE, DEGREE_REAUMUR, DEKAMETER, DYNE, ELECTRONVOLT, EMU, ERG, ERG_PER_SECOND, ESU, EXA_ELECTRONVOLT, FARADAY, FOOT, FOOT_MERCURY, FOOT_PER_SECOND, FOOT_PER_SECOND_2, FOOT_POUND_FORCE, FOOT_POUND_FORCE_PER_HOUR, FOOT_POUND_FORCE_PER_MINUTE, FOOT_POUND_FORCE_PER_SECOND, FRANKLIN, GAL, GALLON_IMP, GALLON_PER_DAY, GALLON_PER_HOUR, GALLON_PER_MINUTE, GALLON_PER_SECOND, GALLON_US_FLUID, GIGA_ELECTRONVOLT, GIGAHERTZ, GIGAWATT, GIGAWATT_HOUR, GRAD, GRAM, GRAM_PER_CENTIMETER_3, HECTARE, HECTOMETER, HECTOPASCAL, HERTZ, HORSEPOWER_METRIC, HOUR, INCH, INCH_MERCURY, INCH_PER_SECOND_2, INCH_POUND_FORCE, JOULE, KELVIN, KG_PER_METER_3, KGF_PER_SQUARE_MM, KILO_ELECTRONVOLT, KILOAMPERE, KILOCALORIE, KILOGRAM, KILOGRAM_FORCE, KILOGRAM_PER_SECOND, KILOHERTZ, KILOMETER, KILOOHM, KILOPASCAL, KILOVOLT, KILOWATT, KILOWATT_HOUR, KM_PER_HOUR, KM_PER_HOUR_2, KNOT, KNOT_PER_SECOND, LITER, LITER_PER_DAY, LITER_PER_HOUR, LITER_PER_MINUTE, LITER_PER_SECOND, MEGA_ELECTRONVOLT, MEGAHERTZ, MEGAOHM, MEGAVOLT, MEGAWATT, MEGAWATT_HOUR, METER, METER_KILOGRAM_FORCE, METER_PER_SECOND, METER_PER_SECOND_2, MICROAMPERE, MICROVOLT, MICROWATT_HOUR, MILE, MILE_PER_HOUR, MILE_PER_HOUR_2, MILE_PER_HOUR_PER_SECOND, MILLI_ELECTRONVOLT, MILLIAMPERE, MILLIAMPERE_HOUR, MILLIBAR, MILLIMETER, MILLIMETER_MERCURY, MILLIOHM, MILLISECOND, MILLIVOLT, MILLIWATT_HOUR, MINUTE, NANOAMPERE, NAUTICAL_MILE, NEWTON, NEWTON_METER, OHM, OUNCE, OUNCE_FORCE, OUNCE_IMP_FLUID, OUNCE_US_FLUID, PASCAL, PER_CENTIMETER, PER_DAY, PER_DECIMETER, PER_DEKAMETER, PER_FOOT, PER_HECTOMETER, PER_HOUR, PER_INCH, PER_KILOMETER, PER_METER, PER_MILE, PER_MILLIMETER, PER_MILLISECOND, PER_MINUTE, PER_NAUTICAL_MILE, PER_SECOND, PER_WEEK, PER_YARD, PETA_ELECTRONVOLT, PIEZE, PINT_IMP, PINT_US_FLUID, POUND, POUND_FOOT, POUND_FORCE, POUND_INCH, POUND_PER_SECOND, POUND_PER_SQUARE_FOOT, POUND_PER_SQUARE_INCH, QUART_IMP, QUART_US_FLUID, RAD, RADIAN, RPM, SECOND, SLOPE_ARCMINUTE, SLOPE_ARCSECOND, SLOPE_CENTESIMAL_ARCMINUTE, SLOPE_CENTESIMAL_ARCSECOND, SLOPE_DEGREE, SLOPE_GRAD, SLOPE_RADIAN, SQUARE_CENTIMETER, SQUARE_DEGREE, SQUARE_FOOT, SQUARE_INCH, SQUARE_METER, SQUARE_MILE, SQUARE_MILLIMETER, SQUARE_YARD, STANDARD_GRAVITY, STATAMPERE, STATCOULOMB, STATVOLT, STERADIAN, STHENE, STHENE_METER, STHENE_METER_PER_SECOND, TERA_ELECTRONVOLT, TERAHERTZ, TERAWATT_HOUR, TON_FORCE, TON_LONG, TON_METRIC, TON_SHORT, TONNE, TORR, VOLT, WATT, WATT_HOUR, WEEK, YARD
Constructor and Description |
---|
SimpleAnimator(org.djunits.value.vdouble.scalar.Time.Abs startTime,
org.djunits.value.vdouble.scalar.Time.Rel warmupPeriod,
org.djunits.value.vdouble.scalar.Time.Rel runLength,
OTSModelInterface model)
Create a simulation engine with animation; the easy way.
|
Modifier and Type | Method and Description |
---|---|
void |
run() |
void |
runOld() |
nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEvent<OTSSimTimeDouble> |
scheduleEvent(org.djunits.value.vdouble.scalar.Time.Abs executionTime,
short priority,
Object source,
Object target,
String method,
Object[] args)
Construct and schedule a SimEvent using a DoubleScalar.Abs<TimeUnit> to specify the execution time.
|
initialize, relativeMillis, runUpTo, scheduleEventAbs, scheduleEventAbs, scheduleEventRel, scheduleEventRel
getSpeedFactor, isCatchup, setCatchup, setSpeedFactor
getAnimationDelay, setAnimationDelay, updateAnimation
autoPauseSimulator, cancelEvent, getEventList, isPauseOnError, runUpTo, scheduleEvent, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventNow, scheduleEventNow, scheduleEventRel, scheduleEventRel, setEventList, setPauseOnError, step, stop
cleanUp, getReplication, getSimulatorTime, isRunning, start
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, toString, wait, wait, wait
cancelEvent, getEventList, runUpTo, scheduleEvent, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventAbs, scheduleEventNow, scheduleEventNow, scheduleEventRel, scheduleEventRel, setEventList
isPauseOnError, runUpTo, scheduleEventAbs, scheduleEventAbs, scheduleEventRel, scheduleEventRel, setPauseOnError
getSimulatorTime, initialize, isRunning, start, step, stop
getReplication
public SimpleAnimator(org.djunits.value.vdouble.scalar.Time.Abs startTime, org.djunits.value.vdouble.scalar.Time.Rel warmupPeriod, org.djunits.value.vdouble.scalar.Time.Rel runLength, OTSModelInterface model) throws nl.tudelft.simulation.dsol.SimRuntimeException, NamingException
startTime
- DoubleScalar.Abs<TimeUnit>; the start time of the simulationwarmupPeriod
- DoubleScalar.Rel<TimeUnit>; the warm up period of the simulation (use new
DoubleScalar.Rel<TimeUnit>(0, SECOND) if you don't know what this is)runLength
- DoubleScalar.Rel<TimeUnit>; the duration of the simulationmodel
- OTSModelInterface; the simulation to executenl.tudelft.simulation.dsol.SimRuntimeException
- on ???NamingException
- when context for the animation cannot be createdpublic final nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEvent<OTSSimTimeDouble> scheduleEvent(org.djunits.value.vdouble.scalar.Time.Abs executionTime, short priority, Object source, Object target, String method, Object[] args) throws nl.tudelft.simulation.dsol.SimRuntimeException
scheduleEvent
in interface SimpleSimulatorInterface
executionTime
- DoubleScalar.Abs<TimeUnit>; 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 eventnl.tudelft.simulation.dsol.SimRuntimeException
- when the executionTime
is in the pastpublic void run()
run
in interface Runnable
run
in class nl.tudelft.simulation.dsol.simulators.DEVSRealTimeClock<org.djunits.value.vdouble.scalar.DoubleScalar.Abs<org.djunits.unit.TimeUnit>,org.djunits.value.vdouble.scalar.DoubleScalar.Rel<org.djunits.unit.TimeUnit>,OTSSimTimeDouble>
public void runOld()
Copyright © 2014–2015 Delft University of Technology. All rights reserved.