Class NetworksModel

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

public class NetworksModel extends AbstractOtsModel implements 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-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Peter Knoppers
  • Constructor Details

    • NetworksModel

      public NetworksModel(OtsSimulatorInterface simulator)
      Constructor.
      Parameters:
      simulator - the simulator for this model
  • Method Details

    • constructModel

      public final void constructModel() throws nl.tudelft.simulation.dsol.SimRuntimeException
      Specified by:
      constructModel in interface nl.tudelft.simulation.dsol.model.DsolModel<Duration,OtsSimulatorInterface>
      Throws:
      nl.tudelft.simulation.dsol.SimRuntimeException
    • notify

      public void notify(Event event)
      Specified by:
      notify in interface EventListener
    • getNetwork

      public RoadNetwork getNetwork()
      Specified by:
      getNetwork in interface OtsModelInterface
    • getPath

      public final List<Lane> getPath(int index)
      Returns path.
      Parameters:
      index - the rank number of the path
      Returns:
      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:
      the number of paths that can be used to show graphs
    • getMinimumDistance

      public final Length getMinimumDistance()
      Returns minimum distance.
      Returns:
      minimumDistance
    • getMaximumDistance

      public final Length getMaximumDistance()
      Returns maximum distance.
      Returns:
      maximumDistance