1 package org.opentrafficsim.simulationengine;
2
3 import org.djunits.value.vdouble.scalar.Time;
4 import org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface;
5 import org.opentrafficsim.core.dsol.OTSSimTimeDouble;
6
7 import nl.tudelft.simulation.dsol.SimRuntimeException;
8 import nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEvent;
9
10 /**
11 * <p>
12 * Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
13 * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
14 * <p>
15 * $LastChangedDate: 2016-10-16 23:21:49 +0200 (Sun, 16 Oct 2016) $, @version $Revision: 2387 $, by $Author: averbraeck $,
16 * initial version 11 mei 2015 <br>
17 * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
18 * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
19 */
20 public interface SimpleSimulatorInterface extends OTSDEVSSimulatorInterface
21 {
22 /**
23 * Construct and schedule a SimEvent using a Time to specify the execution time.
24 * @param executionTime Time; the time at which the event must happen
25 * @param priority short; should be between <cite>SimEventInterface.MAX_PRIORITY</cite> and
26 * <cite>SimEventInterface.MIN_PRIORITY</cite>; most normal events should use
27 * <cite>SimEventInterface.NORMAL_PRIORITY</cite>
28 * @param source Object; the object that creates/schedules the event
29 * @param target Object; the object that must execute the event
30 * @param method String; the name of the method of <code>target</code> that must execute the event
31 * @param args Object[]; the arguments of the <code>method</code> that must execute the event
32 * @return SimEvent<OTSSimTimeDouble>; the event that was scheduled (the caller should save this if a need to cancel
33 * the event may arise later)
34 * @throws SimRuntimeException when the <code>executionTime</code> is in the past
35 */
36 SimEvent<OTSSimTimeDouble> scheduleEvent(final Time executionTime, final short priority, final Object source,
37 final Object target, final String method, final Object[] args) throws SimRuntimeException;
38
39 }