Class CircularLaneModel

  • All Implemented Interfaces:
    Serializable, DSOLModel<Duration,​org.opentrafficsim.core.dsol.OTSSimulatorInterface>, UNITS, EventProducerInterface, org.opentrafficsim.core.dsol.OTSModelInterface

    public class CircularLaneModel
    extends org.opentrafficsim.core.dsol.AbstractOTSModel
    implements UNITS
    Simulate traffic on a circular, one-lane road.

    Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
    BSD-style license. See OpenTrafficSim License.

    $LastChangedDate: 2018-11-18 20:49:04 +0100 (Sun, 18 Nov 2018) $, @version $Revision: 4743 $, by $Author: averbraeck $, initial version 1 nov. 2014

    Author:
    Peter Knoppers
    See Also:
    Serialized Form
    • Constructor Detail

      • CircularLaneModel

        public CircularLaneModel​(org.opentrafficsim.core.dsol.OTSSimulatorInterface simulator)
        Parameters:
        simulator - OTSSimulatorInterface; the simulator for this model
    • Method Detail

      • makeInputParameterMap

        public void makeInputParameterMap()
        Make a map of input parameters for this demo.
      • generateCar

        protected final void generateCar​(Lane lane,
                                         Length initialPosition)
                                  throws org.opentrafficsim.core.gtu.GTUException
        Generate one gtu.
        Parameters:
        initialPosition - Length; the initial position of the new cars
        lane - Lane; the lane on which the new cars are placed
        Throws:
        org.opentrafficsim.core.gtu.GTUException - when something goes wrong during construction of the car
      • getPath

        public List<Lane> getPath()
        Returns:
        List<Lane>; the set of lanes for the specified index
      • getNetwork

        public OTSRoadNetwork getNetwork()
        Specified by:
        getNetwork in interface org.opentrafficsim.core.dsol.OTSModelInterface
      • getMinimumDistance

        public final Length getMinimumDistance()
        Returns:
        minimumDistance
      • stopSimulator

        public void stopSimulator​(org.opentrafficsim.core.dsol.OTSSimulatorInterface theSimulator,
                                  String errorMessage)
        Stop simulation and throw an Error.
        Parameters:
        theSimulator - OTSSimulatorInterface; the simulator
        errorMessage - String; the error message