Class CrossingTrafficLightsModel

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

    public class CrossingTrafficLightsModel
    extends org.opentrafficsim.core.dsol.AbstractOTSModel
    implements UNITS
    Simulate four double lane roads with a crossing in the middle.

    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: 2016-10-28 16:34:11 +0200 (Fri, 28 Oct 2016) $, @version $Revision: 2429 $, by $Author: pknoppers $, initial version ug 1, 2014
    Author:
    Peter Knoppers
    See Also:
    Serialized Form
    • Field Detail

      • headwayGenerator

        protected DistContinuous headwayGenerator
        The probability distribution for the variable part of the headway.
    • Constructor Detail

      • CrossingTrafficLightsModel

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

      • makeTemplate

        LaneBasedTemplateGTUType 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<DirectedLanePosition> initialPositions,
                                              LaneBasedStrategicalPlannerFactory<LaneBasedStrategicalPlanner> strategicalPlannerFactory,
                                              org.opentrafficsim.core.distributions.Generator<org.opentrafficsim.core.network.route.Route> routeGenerator)
                                       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<DirectedLanePosition>; initial position(s) of the GTU on the Lane(s)
        strategicalPlannerFactory - LaneBasedStrategicalPlannerFactory<LaneBasedStrategicalPlanner>; factory to generate the strategical planner for the GTU
        routeGenerator - the route generator
        Returns:
        template for a GTU
        Throws:
        org.opentrafficsim.core.gtu.GTUException - when characteristics cannot be initialized
      • getNetwork

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