Class AbstractLaneBasedTacticalPlanner

    • Constructor Detail

      • AbstractLaneBasedTacticalPlanner

        public AbstractLaneBasedTacticalPlanner​(CarFollowingModel carFollowingModel,
                                                InternalLaneBasedGtu gtu,
                                                LanePerception lanePerception)
        Instantiates a tactical planner.
        Parameters:
        carFollowingModel - CarFollowingModel; car-following model
        gtu - InternalLaneBasedGtu; GTU
        lanePerception - LanePerception; perception
    • Method Detail

      • buildLanePathInfo

        public LanePathInfo buildLanePathInfo​(Length maxHeadway)
                                       throws GtuException,
                                              NetworkException
        Build a list of lanes forward, with a maximum headway relative to the reference point of the GTU.
        Specified by:
        buildLanePathInfo in interface LaneBasedTacticalPlanner
        Parameters:
        maxHeadway - Length; the maximum length for which lanes should be returned
        Returns:
        LanePathInfo; an instance that provides the following information for an operational plan: the lanes to follow, and the path to follow when staying on the same lane.
        Throws:
        GtuException - when the vehicle is not on one of the lanes on which it is registered
        NetworkException - when the strategic planner is not able to return a next node in the route
      • buildLanePathInfo

        public LanePathInfo buildLanePathInfo​(Length maxHeadway,
                                              Lane startLane,
                                              Length position,
                                              GtuDirectionality startDirectionality)
                                       throws GtuException,
                                              NetworkException
        Build a list of lanes forward, with a maximum headway relative to the reference point of the GTU.
        Specified by:
        buildLanePathInfo in interface LaneBasedTacticalPlanner
        Parameters:
        maxHeadway - Length; the maximum length for which lanes should be returned
        startLane - Lane; the lane in which the path starts
        position - Length; the position on the start lane
        startDirectionality - GtuDirectionality; the driving direction on the start lane
        Returns:
        LanePathInfo; an instance that provides the following information for an operational plan: the lanes to follow, and the path to follow when staying on the same lane.
        Throws:
        GtuException - when the vehicle is not on one of the lanes on which it is registered
        NetworkException - when the strategic planner is not able to return a next node in the route
      • concatenateNull

        public static PolyLine3d concatenateNull​(PolyLine3d path,
                                                 PolyLine3d centerLine)
        Concatenate two paths, where the first may be null.
        Parameters:
        path - PolyLine3d; path, may be null
        centerLine - PolyLine3d; center line of lane to add
        Returns:
        concatenated line
      • determineNextSplit

        public NextSplitInfo determineNextSplit​(Length maxHeadway)
                                         throws GtuException,
                                                NetworkException
        Calculate the next location where the network splits, with a maximum headway relative to the reference point of the GTU. Note: a lane drop is also considered a split (!).
        Specified by:
        determineNextSplit in interface LaneBasedTacticalPlanner
        Parameters:
        maxHeadway - Length; the maximum length for which lanes should be returned
        Returns:
        NextSplitInfo; an instance that provides the following information for an operational plan: whether the network splits, the node where it splits, and the current lanes that lead to the right node after the split node.
        Throws:
        GtuException - when the vehicle is not on one of the lanes on which it is registered
        NetworkException - when the strategic planner is not able to return a next node in the route
      • connectsToPath

        protected boolean connectsToPath​(Length maxHeadway,
                                         Lane startLane,
                                         Length startLanePosition,
                                         GtuDirectionality startDirectionality,
                                         Link linkAfterSplit)
                                  throws GtuException,
                                         NetworkException
        Determine whether the lane is directly connected to our route, in other words: if we would (continue to) drive on the given lane, can we take the right branch at the nextSplitNode without switching lanes?
        Parameters:
        maxHeadway - Length; the maximum length for use in the calculation
        startLane - Lane; the first lane in the list
        startLanePosition - Length; the position on the start lane
        startDirectionality - GtuDirectionality; the driving direction on the start lane
        linkAfterSplit - Link; the link after the split to which we should connect
        Returns:
        boolean; true if the lane (XXXXX which lane?) is connected to our path
        Throws:
        GtuException - when the vehicle is not on one of the lanes on which it is registered
        NetworkException - when the strategic planner is not able to return a next node in the route
      • noLaneDrop

        protected boolean noLaneDrop​(Length maxHeadway,
                                     Lane startLane,
                                     Length startLanePosition,
                                     GtuDirectionality startDirectionality)
                              throws GtuException,
                                     NetworkException
        Determine whether the lane does not drop, in other words: if we would (continue to) drive on the given lane, can we continue to drive at the nextSplitNode without switching lanes?
        Parameters:
        maxHeadway - Length; the maximum length for use in the calculation
        startLane - Lane; the first lane in the list
        startLanePosition - Length; the position on the start lane
        startDirectionality - GtuDirectionality; the driving direction on the start lane
        Returns:
        boolean; true if the lane (XXX which lane?) is connected to our path
        Throws:
        GtuException - when the vehicle is not on one of the lanes on which it is registered
        NetworkException - when the strategic planner is not able to return a next node in the route
      • buildLinkListForward

        protected List<LinkDirection> buildLinkListForward​(Length maxHeadway)
                                                    throws GtuException,
                                                           NetworkException
        Make a list of links on which to drive next, with a maximum headway relative to the reference point of the GTU.
        Parameters:
        maxHeadway - Length; the maximum length for which links should be returned
        Returns:
        List<LinkDirection>; a list of links on which to drive next
        Throws:
        GtuException - when the vehicle is not on one of the lanes on which it is registered
        NetworkException - when the strategic planner is not able to return a next node in the route
      • setCarFollowingModel

        public final void setCarFollowingModel​(CarFollowingModel carFollowingModel)
        Sets the car-following model.
        Parameters:
        carFollowingModel - CarFollowingModel; Car-following model to set.