Class AbstractGTUGeneratorOld

  • All Implemented Interfaces:
    Serializable, Locatable, EventProducerInterface, GtuGeneratorQueue
    Direct Known Subclasses:
    GTUGeneratorIndividualOld

    public abstract class AbstractGTUGeneratorOld
    extends EventProducer
    implements Serializable, GtuGeneratorQueue
    Common code for LaneBasedGTU generators that may have to postpone putting a GTU on the road due to congestion growing into the generator.
    Generally, these generators will discover that there is not enough room AFTER having decided what kind (particular length) of GTU will be constructed next. When this happens, the generator must remember the properties of the GTU, but postpone actual generation until there is enough room.

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

    Version:
    $Revision: 1401 $, $LastChangedDate: 2015-09-14 01:33:02 +0200 (Mon, 14 Sep 2015) $, by $Author: averbraeck $, initial version Feb 2, 2015
    Author:
    Alexander Verbraeck, Peter Knoppers
    See Also:
    Serialized Form
    • Field Detail

      • numberGTUs

        protected long numberGTUs
        Number of generated GTUs.
    • Constructor Detail

      • AbstractGTUGeneratorOld

        public AbstractGTUGeneratorOld​(String name,
                                       DEVSSimulatorInterface.TimeDoubleUnit simulator,
                                       GTUType gtuType,
                                       Class<?> gtuClass,
                                       ContinuousDistDoubleScalar.Rel<Speed,​SpeedUnit> initialSpeedDist,
                                       ContinuousDistDoubleScalar.Rel<Duration,​DurationUnit> interarrivelTimeDist,
                                       long maxGTUs,
                                       Time startTime,
                                       Time endTime,
                                       Lane lane,
                                       Length position,
                                       GTUDirectionality direction,
                                       LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner> strategicalPlannerFactory,
                                       Generator<Route> routeGenerator,
                                       OTSRoadNetwork network)
                                throws SimRuntimeException
        Parameters:
        name - String; the name of the generator
        simulator - DEVSSimulatorInterface.TimeDoubleUnit; the simulator to schedule the start of the generation
        gtuType - GTUType; the type of GTU to generate
        gtuClass - Class<?>; the GTU class to instantiate
        initialSpeedDist - ContinuousDistDoubleScalar.Rel<Speed,SpeedUnit>; distribution of the initial speed of the GTU
        interarrivelTimeDist - ContinuousDistDoubleScalar.Rel<Duration,DurationUnit>; distribution of the interarrival time
        maxGTUs - long; maximum number of GTUs to generate
        startTime - Time; start time of generation (delayed start)
        endTime - Time; end time of generation
        lane - Lane; the lane to generate the GTU on
        position - Length; position on the lane, relative to the design line of the link
        direction - GTUDirectionality; the direction on the lane in which the GTU has to be generated (DIR_PLUS, or DIR_MINUS)
        strategicalPlannerFactory - LaneBasedStrategicalPlannerFactory<? extends LaneBasedStrategicalPlanner>; the lane-based strategical planner factory to use
        routeGenerator - Generator<Route>; route generator
        network - OTSRoadNetwork; the network to register the generated GTUs into
        Throws:
        SimRuntimeException - when simulation scheduling fails