Class NetworksModel

java.lang.Object
org.djutils.event.LocalEventProducer
nl.tudelft.simulation.dsol.model.AbstractDSOLModel<Duration,org.opentrafficsim.core.dsol.OtsSimulatorInterface>
org.opentrafficsim.core.dsol.AbstractOtsModel
org.opentrafficsim.demo.NetworksModel
All Implemented Interfaces:
Serializable, Remote, EventListener, DSOLModel<Duration,org.opentrafficsim.core.dsol.OtsSimulatorInterface>, UNITS, org.djutils.event.EventListener, org.djutils.event.EventProducer, org.opentrafficsim.core.dsol.OtsModelInterface

public class NetworksModel extends org.opentrafficsim.core.dsol.AbstractOtsModel implements org.djutils.event.EventListener, UNITS
Simulate a single lane road of 5 km length. Vehicles are generated at a constant rate of 1500 veh/hour. At time 300s a blockade is inserted at position 4 km; this blockade is removed at time 500s. The used car following algorithm is IDM+ Integrated Lane Change Model with Relaxation and Synchronization, by Wouter J. Schakel, Victor L. Knoop and Bart van Arem, 2012.
Output is a set of block charts:
  • Traffic density
  • Speed
  • Flow
  • Acceleration
All these graphs display simulation time along the horizontal axis and distance along the road along the vertical axis.

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

Author:
Peter Knoppers
See Also:
  • Constructor Details

    • NetworksModel

      public NetworksModel(org.opentrafficsim.core.dsol.OtsSimulatorInterface simulator)
      Parameters:
      simulator - OtsSimulatorInterface; the simulator for this model
  • Method Details

    • constructModel

      public final void constructModel() throws SimRuntimeException
      Specified by:
      constructModel in interface DSOLModel<Duration,org.opentrafficsim.core.dsol.OtsSimulatorInterface>
      Throws:
      SimRuntimeException
    • makeTemplate

      LaneBasedGtuTemplate makeTemplate(StreamInterface randStream, Lane lane, org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<Length,LengthUnit> lengthDistribution, org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<Length,LengthUnit> widthDistribution, org.opentrafficsim.core.units.distributions.ContinuousDistDoubleScalar.Rel<Speed,SpeedUnit> maximumSpeedDistribution, Set<LanePosition> initialPositions, LaneBasedStrategicalPlannerFactory<?> strategicalPlannerFactory) throws org.opentrafficsim.core.gtu.GtuException
      Parameters:
      randStream - StreamInterface; the random stream to use
      lane - Lane; reference lane to generate GTUs on
      lengthDistribution - ContinuousDistDoubleScalar.Rel<Length,LengthUnit>; distribution of the GTU length
      widthDistribution - ContinuousDistDoubleScalar.Rel<Length,LengthUnit>; distribution of the GTU width
      maximumSpeedDistribution - ContinuousDistDoubleScalar.Rel<Speed,SpeedUnit>; distribution of the GTU's maximum speed
      initialPositions - Set<LanePosition>; initial position(s) of the GTU on the Lane(s)
      strategicalPlannerFactory - LaneBasedStrategicalPlannerFactory<?>; factory to generate the strategical planner for the GTU
      Returns:
      template for a GTU
      Throws:
      org.opentrafficsim.core.gtu.GtuException - when characteristics cannot be initialized
    • notify

      public void notify(org.djutils.event.Event event) throws RemoteException
      Specified by:
      notify in interface org.djutils.event.EventListener
      Throws:
      RemoteException
    • getNetwork

      public RoadNetwork getNetwork()
      Specified by:
      getNetwork in interface org.opentrafficsim.core.dsol.OtsModelInterface
    • getPath

      public final List<Lane> getPath(int index)
      Parameters:
      index - int; the rank number of the path
      Returns:
      List<Lane>; the set of lanes for the specified index
    • pathCount

      public final int pathCount()
      Return the number of paths that can be used to show graphs.
      Returns:
      int; the number of paths that can be used to show graphs
    • getMinimumDistance

      public final Length getMinimumDistance()
      Returns:
      minimumDistance
    • getMaximumDistance

      public final Length getMaximumDistance()
      Returns:
      maximumDistance