Package strategies
Class StrategiesDemo
java.lang.Object
org.opentrafficsim.swing.script.AbstractSimulationScript
strategies.StrategiesDemo
- All Implemented Interfaces:
java.util.EventListener
,EventListenerInterface
,Checkable
public class StrategiesDemo extends AbstractSimulationScript
Demo of lane change strategies.
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version 4 jun. 2018
- Author:
- Wouter Schakel
-
Constructor Summary
Constructors Modifier Constructor Description protected
StrategiesDemo()
Constructor. -
Method Summary
Modifier and Type Method Description void
createGtu(Lane lane, Length pos, GTUType gtuType, Speed initialSpeed, OTSRoadNetwork net)
Creates a GTU.static void
main(java.lang.String[] args)
Main method.protected void
setupDemo(OTSAnimationPanel animation, OTSRoadNetwork network)
protected OTSRoadNetwork
setupSimulation(OTSSimulatorInterface sim)
Methods inherited from class org.opentrafficsim.swing.script.AbstractSimulationScript
addTabs, animateNetwork, check, getGtuColorer, getNetwork, getSeed, getSimulationTime, getSimulator, getStartTime, getWarmupTime, isAutorun, notify, onSimulationEnd, setAnimationToggles, setGtuColorer, start
-
Constructor Details
-
StrategiesDemo
protected StrategiesDemo()Constructor.
-
-
Method Details
-
main
public static void main(java.lang.String[] args)Main method.- Parameters:
args
- String[]; arguments
-
setupDemo
- Overrides:
setupDemo
in classAbstractSimulationScript
-
setupSimulation
- Specified by:
setupSimulation
in classAbstractSimulationScript
- Throws:
java.lang.Exception
-
createGtu
public void createGtu(Lane lane, Length pos, GTUType gtuType, Speed initialSpeed, OTSRoadNetwork net) throws javax.naming.NamingException, GTUException, NetworkException, SimRuntimeException, OTSGeometryExceptionCreates a GTU.- Parameters:
lane
- Lane; lanepos
- Length; positiongtuType
- GTUType; GTU typeinitialSpeed
- Speed; initial speednet
- OTSRoadNetwork; network- Throws:
javax.naming.NamingException
- on exceptionGTUException
- on exceptionNetworkException
- on exceptionSimRuntimeException
- on exceptionOTSGeometryException
- on exception
-