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