Class LaneBasedOperationalPlan

java.lang.Object
org.opentrafficsim.core.gtu.plan.operational.OperationalPlan
org.opentrafficsim.road.gtu.lane.plan.operational.LaneBasedOperationalPlan
All Implemented Interfaces:
Serializable

public class LaneBasedOperationalPlan extends OperationalPlan
An operational plan with some extra information about the lanes and lane changes so this information does not have to be recalculated multiple times. Furthermore, it is quite expensive to check whether a lane change is part of the oprtational plan based on geographical data.

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
See Also:
  • Constructor Details

    • LaneBasedOperationalPlan

      public LaneBasedOperationalPlan(LaneBasedGtu gtu, OtsLine2d path, org.djunits.value.vdouble.scalar.Time startTime, Segments segments, boolean deviative) throws OperationalPlanException
      Construct an operational plan with or without a lane change.
      Parameters:
      gtu - LaneBasedGtu; the GTU for debugging purposes
      path - OtsLine2d; the path to follow from a certain time till a certain time. The path should have <i>at least</i> the length
      startTime - Time; the absolute start time when we start executing the path
      segments - Segments; the segments that make up the path with an acceleration, constant speed or deceleration profile
      deviative - boolean; whether the path is not along lane center lines
      Throws:
      OperationalPlanException - when the path is too short for the operation
  • Method Details

    • isDeviative

      public final boolean isDeviative()
      Check if we deviate from the center line.
      Returns:
      whether this maneuver involves deviation from the center line.
    • getTotalLengthAlongLane

      public final org.djunits.value.vdouble.scalar.Length getTotalLengthAlongLane(LaneBasedGtu gtu) throws GtuException
      Returns the total length along the reference lane that the GTU travels. In case of a deviative plan this involves projection of the actual path to the lane center lines.
      Parameters:
      gtu - LaneBasedGtu; GTU
      Returns:
      Length; total length along the path
      Throws:
      GtuException - if the GTU has not reference position
    • getDistanceAlongLane

      public final org.djunits.value.vdouble.scalar.Length getDistanceAlongLane(LaneBasedGtu gtu, org.djutils.draw.point.OrientedPoint2d point) throws GtuException
      Returns the distance along the reference lane that the GTU travels from the current location up to the point.
      Parameters:
      gtu - LaneBasedGtu; GTU
      point - OrientedPoint2d; point where the GTU is or will be
      Returns:
      Length; total length along the path
      Throws:
      GtuException - if the GTU has not reference position
    • toString

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