Class AbstractLaneBasedStrategicalPlannerFactory<T extends LaneBasedStrategicalPlanner>

  • Type Parameters:
    T - class of the strategical planner generated
    All Implemented Interfaces:
    LaneBasedStrategicalPlannerFactory<T>
    Direct Known Subclasses:
    LaneBasedStrategicalRoutePlannerFactory

    public abstract class AbstractLaneBasedStrategicalPlannerFactory<T extends LaneBasedStrategicalPlanner>
    extends java.lang.Object
    implements LaneBasedStrategicalPlannerFactory<T>
    Factory for creating LaneBasedStrategicalRoutePlanner using any LaneBasedTacticalPlannerFactory. This abstract class deals with forwarding peeking from the GTU generator to the tactical planner factory. Parameters are set using a ParameterFactory, after the method setParameters() has been called, which subclasses need to implement.

    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$, $LastChangedDate$, by $Author$, initial version 12 jan. 2018
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Constructor Detail

      • AbstractLaneBasedStrategicalPlannerFactory

        public AbstractLaneBasedStrategicalPlannerFactory​(LaneBasedTacticalPlannerFactory<? extends LaneBasedTacticalPlanner> tacticalPlannerFactory)
        Constructor with factory for tactical planners.
        Parameters:
        tacticalPlannerFactory - LaneBasedTacticalPlannerFactory<? extends LaneBasedTacticalPlanner>; factory for tactical planners
      • AbstractLaneBasedStrategicalPlannerFactory

        public AbstractLaneBasedStrategicalPlannerFactory​(LaneBasedTacticalPlannerFactory<? extends LaneBasedTacticalPlanner> tacticalPlannerFactory,
                                                          ParameterFactory parametersFactory)
        Constructor with factory for tactical planners.
        Parameters:
        tacticalPlannerFactory - LaneBasedTacticalPlannerFactory<? extends LaneBasedTacticalPlanner>; factory for tactical planners
        parametersFactory - ParameterFactory; factory for parameters
    • Method Detail

      • peekDesiredSpeed

        public final Speed peekDesiredSpeed​(GTUType gtuType,
                                            Speed speedLimit,
                                            Speed maxGtuSpeed)
                                     throws GTUException
        Peek to see the desired speed of the next GTU to be generated at the given location. The default implementation returns null, at which point the GTU generator will use some other speed.
        Specified by:
        peekDesiredSpeed in interface LaneBasedStrategicalPlannerFactory<T extends LaneBasedStrategicalPlanner>
        Parameters:
        gtuType - GTUType; GTU type
        speedLimit - Speed; speed limit
        maxGtuSpeed - Speed; maximum GTU speed
        Returns:
        desired speed of the next GTU to be generated at the given location, may be null at which point the GTU generator will use some other speed
        Throws:
        GTUException - on parameter exception or network exception
      • peekDesiredHeadway

        public final Length peekDesiredHeadway​(GTUType gtuType,
                                               Speed speed)
                                        throws GTUException
        Peek to see the desired headway of the next GTU to be generated at the given speed. The default implementation returns null, at which point the GTU generator will only generate GTU's at fixed locations.
        Specified by:
        peekDesiredHeadway in interface LaneBasedStrategicalPlannerFactory<T extends LaneBasedStrategicalPlanner>
        Parameters:
        gtuType - GTUType; GTU type
        speed - Speed; speed the GTU might be generated at
        Returns:
        Length; desired headway of the next GTU to be generated at the given speed, may be null at which point the GTU generator only generate GTU's at fixed locations
        Throws:
        GTUException - on parameter exception or network exception
      • getParameters

        protected abstract Parameters getParameters()
        Returns parameters specific to the strategical planner. The input already contains parameters from the tactical planner. After this method, the ParameterFactory sets or overwrites additional parameters. Hence, this method may set default (distributed) values for parameters specific to the strategical planner.
        Returns:
        parameters Parameters; parameters for the strategical planner, may be null
      • nextParameters

        protected final Parameters nextParameters​(GTUType gtuType)
                                           throws GTUException
        Returns the parameters for the next GTU.
        Parameters:
        gtuType - GTUType; GTU type of GTU to be generated
        Returns:
        Parameters; parameters for the next GTU
        Throws:
        GTUException - on parameter exception
      • nextTacticalPlanner

        protected final LaneBasedTacticalPlanner nextTacticalPlanner​(LaneBasedGTU gtu)
                                                              throws GTUException
        Returns the next tactical planner.
        Parameters:
        gtu - LaneBasedGTU; GTU to be generated
        Returns:
        T; next tactical planner
        Throws:
        GTUException - on exception during tactical planner creation