View Javadoc
1   package org.opentrafficsim.simulationengine;
2   
3   import java.util.ArrayList;
4   
5   import javax.naming.NamingException;
6   
7   import nl.tudelft.simulation.dsol.SimRuntimeException;
8   
9   import org.djunits.value.vdouble.scalar.DOUBLE_SCALAR.Time;
10  import org.opentrafficsim.core.network.NetworkException;
11  import org.opentrafficsim.simulationengine.properties.AbstractProperty;
12  
13  /**
14   * Requirements for demonstration that can be shown in the SuperDemo.
15   * <p>
16   * Copyright (c) 2013-2015 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
17   * BSD-style license. See <a href="http://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
18   * <p>
19   * $LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, @version $Revision: 1401 $, by $Author: averbraeck $,
20   * initial version 17 dec. 2014 <br>
21   * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
22   */
23  public interface WrappableSimulation
24  {
25      /**
26       * Build the simulation.
27       * @param startTime DoubleScalar.Abs&lt;TimeUnit&gt;; the start time of the simulation
28       * @param warmupPeriod DoubleScalar.Rel&lt;TimeUnit&gt;; the warm up period of the simulation (use new
29       *            DoubleScalar.Rel&lt;TimeUnit&gt;(0, SECOND) if you don't know what this is)
30       * @param runLength DoubleScalar.Rel&lt;TimeUnit&gt;; the duration of the simulation
31       * @param properties ArrayList&lt;AbstractProperty&lt;?&gt;&gt;; the (possibly user-modified) properties. This list must
32       *            contain all the properties returned by getProperties(); any additional properties may be ignored
33       * @return SimpleSimulation; the new simulation
34       * @throws SimRuntimeException on ???
35       * @throws NetworkException on Network inconsistency
36       * @throws NamingException when context for the animation cannot be created
37       */
38      SimpleSimulatorInterface buildSimulator(final Time.Abs startTime, final Time.Rel warmupPeriod, final Time.Rel runLength,
39          ArrayList<AbstractProperty<?>> properties) throws SimRuntimeException, NetworkException,
40          NamingException;
41  
42      /**
43       * Return a very short description of the simulation.
44       * @return String; short description of the simulation
45       */
46      String shortName();
47  
48      /**
49       * Return a description of the simulation (HTML formatted).
50       * @return String; HTML text describing the simulation
51       */
52      String description();
53  
54      /**
55       * Retrieve a list of visible properties of the simulation. <br>
56       * The caller can modify the returned result. If the internal format is also an ArrayList it is highly recommended to make a
57       * protective copy and return that.
58       * @return ArrayList&lt;AbstractProperty&lt;?&gt;&gt;; the list of visible properties
59       */
60      ArrayList<AbstractProperty<?>> getProperties();
61  }