View Javadoc
1   package org.opentrafficsim.simulationengine;
2   
3   import nl.tudelft.simulation.dsol.SimRuntimeException;
4   import nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEvent;
5   
6   import org.djunits.value.vdouble.scalar.Time;
7   import org.opentrafficsim.core.dsol.OTSDEVSSimulatorInterface;
8   import org.opentrafficsim.core.dsol.OTSSimTimeDouble;
9   
10  /**
11   * <p>
12   * Copyright (c) 2013-2015 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: 2015-12-01 00:39:32 +0100 (Tue, 01 Dec 2015) $, @version $Revision: 1601 $, 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.Abs to specify the execution time.
24       * @param executionTime Time.Abs; 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&lt;OTSSimTimeDouble&gt;; 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.Abs executionTime, final short priority, final Object source,
37          final Object target, final String method, final Object[] args) throws SimRuntimeException;
38  
39  }