Class LaneBasedStrategicalRoutePlannerFactory

java.lang.Object
org.opentrafficsim.road.gtu.strategical.LaneBasedStrategicalRoutePlannerFactory
All Implemented Interfaces:
Serializable, LaneBasedStrategicalPlannerFactory<LaneBasedStrategicalRoutePlanner>

public class LaneBasedStrategicalRoutePlannerFactory extends Object implements LaneBasedStrategicalPlannerFactory<LaneBasedStrategicalRoutePlanner>, Serializable
Factory for creating LaneBasedStrategicalRoutePlanner using any LaneBasedTacticalPlannerFactory.

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:
Alexander Verbraeck, Peter Knoppers, Wouter Schakel
See Also:
  • Constructor Details

    • LaneBasedStrategicalRoutePlannerFactory

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

      public LaneBasedStrategicalRoutePlannerFactory(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
    • LaneBasedStrategicalRoutePlannerFactory

      public LaneBasedStrategicalRoutePlannerFactory(LaneBasedTacticalPlannerFactory<? extends LaneBasedTacticalPlanner> tacticalPlannerFactory, ParameterFactory parametersFactory, RouteGenerator routeGenerator)
      Constructor with factory for tactical planners.
      Parameters:
      tacticalPlannerFactory - LaneBasedTacticalPlannerFactory<? extends LaneBasedTacticalPlanner>; factory for tactical planners
      parametersFactory - ParameterFactory; factory for parameters
      routeGenerator - RouteGenerator; route supplier
  • Method Details

    • peekDesiredSpeed

      public final org.djunits.value.vdouble.scalar.Speed peekDesiredSpeed(GtuType gtuType, org.djunits.value.vdouble.scalar.Speed speedLimit, org.djunits.value.vdouble.scalar.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<LaneBasedStrategicalRoutePlanner>
      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 org.djunits.value.vdouble.scalar.Length peekDesiredHeadway(GtuType gtuType, org.djunits.value.vdouble.scalar.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<LaneBasedStrategicalRoutePlanner>
      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
    • create

      public final LaneBasedStrategicalRoutePlanner create(LaneBasedGtu gtu, Route route, Node origin, Node destination) throws GtuException
      Creates a new strategical planner for the given GTU. This method should also set the parameters at the GTU.
      Specified by:
      create in interface LaneBasedStrategicalPlannerFactory<LaneBasedStrategicalRoutePlanner>
      Parameters:
      gtu - LaneBasedGtu; GTU
      route - Route; route, may be null
      origin - Node; origin, may be null
      destination - Node; destination, may be null
      Returns:
      strategical planner for the given GTU
      Throws:
      GtuException - if the gtu is not suitable in any way for the creation of the strategical planner
    • nextParameters

      protected final org.opentrafficsim.base.parameters.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
    • toString

      public final String toString()
      Overrides:
      toString in class Object