Interface LaneStructure

    • Method Detail

      • update

        void update​(DirectedLanePosition pos,
                    Route route,
                    GTUType gtuType)
             throws GTUException
        Updates the underlying structure shifting the root position to the input.
        Parameters:
        pos - DirectedLanePosition; current position of the GTU
        route - Route; current route of the GTU
        gtuType - GTUType; GTU type
        Throws:
        GTUException - on a problem while updating the structure
      • getRootRecord

        LaneStructureRecord getRootRecord()
        Returns the root record.
        Returns:
        LaneRecord; root record
      • getExtendedCrossSection

        SortedSet<RelativeLane> getExtendedCrossSection()
        Returns the extended cross-section, which includes all lanes for which a first record is present.
        Returns:
        SortedSet; the cross-section
      • getFirstRecord

        LaneStructureRecord getFirstRecord​(RelativeLane lane)
        Returns the first record on the given lane. This is often a record in the current cross section, but it may be one downstream for a lane that starts further downstream.
        Parameters:
        lane - RelativeLane; lane
        Returns:
        first record on the given lane, or null if no such record
      • getDownstreamObjects

        <T extends LaneBasedObjectMap<RelativeLane,​SortedSet<LaneStructure.Entry<T>>> getDownstreamObjects​(Class<T> clazz,
                                                                                                                   LaneBasedGTU gtu,
                                                                                                                   RelativePosition.TYPE pos)
                                                                                                            throws GTUException
        Retrieve objects of a specific type. Returns objects over a maximum length of the look ahead distance downstream from the relative position, or as far as the lane structure goes.
        Type Parameters:
        T - type of objects to find
        Parameters:
        clazz - Class<T>; class of objects to find
        gtu - LaneBasedGTU; gtu
        pos - RelativePosition.TYPE; relative position to start search from
        Returns:
        Map; sorted set of objects of requested type per lane
        Throws:
        GTUException - if lane is not in current set
      • getDownstreamObjects

        <T extends LaneBasedObjectSortedSet<LaneStructure.Entry<T>> getDownstreamObjects​(RelativeLane lane,
                                                                                           Class<T> clazz,
                                                                                           LaneBasedGTU gtu,
                                                                                           RelativePosition.TYPE pos)
                                                                                    throws GTUException
        Retrieve objects on a lane of a specific type. Returns objects over a maximum length of the look ahead distance downstream from the relative position, or as far as the lane structure goes.
        Type Parameters:
        T - type of objects to find
        Parameters:
        lane - RelativeLane; lane
        clazz - Class<T>; class of objects to find
        gtu - LaneBasedGTU; gtu
        pos - RelativePosition.TYPE; relative position to start search from
        Returns:
        SortedSet; sorted set of objects of requested type
        Throws:
        GTUException - if lane is not in current set
      • getDownstreamObjectsOnRoute

        <T extends LaneBasedObjectMap<RelativeLane,​SortedSet<LaneStructure.Entry<T>>> getDownstreamObjectsOnRoute​(Class<T> clazz,
                                                                                                                          LaneBasedGTU gtu,
                                                                                                                          RelativePosition.TYPE pos,
                                                                                                                          Route route)
                                                                                                                   throws GTUException
        Retrieve objects of a specific type. Returns objects over a maximum length of the look ahead distance downstream from the relative position, or as far as the lane structure goes. Objects on links not on the route are ignored.
        Type Parameters:
        T - type of objects to find
        Parameters:
        clazz - Class<T>; class of objects to find
        gtu - LaneBasedGTU; gtu
        pos - RelativePosition.TYPE; relative position to start search from
        route - Route; the route
        Returns:
        SortedSet; sorted set of objects of requested type per lane
        Throws:
        GTUException - if lane is not in current set
      • getDownstreamObjectsOnRoute

        <T extends LaneBasedObjectSortedSet<LaneStructure.Entry<T>> getDownstreamObjectsOnRoute​(RelativeLane lane,
                                                                                                  Class<T> clazz,
                                                                                                  LaneBasedGTU gtu,
                                                                                                  RelativePosition.TYPE pos,
                                                                                                  Route route)
                                                                                           throws GTUException
        Retrieve objects on a lane of a specific type. Returns objects over a maximum length of the look ahead distance downstream from the relative position, or as far as the lane structure goes. Objects on links not on the route are ignored.
        Type Parameters:
        T - type of objects to find
        Parameters:
        lane - RelativeLane; lane
        clazz - Class<T>; class of objects to find
        gtu - LaneBasedGTU; gtu
        pos - RelativePosition.TYPE; relative position to start search from
        route - Route; the route
        Returns:
        SortedSet; sorted set of objects of requested type
        Throws:
        GTUException - if lane is not in current set
      • getUpstreamObjects

        <T extends LaneBasedObjectSortedSet<LaneStructure.Entry<T>> getUpstreamObjects​(RelativeLane lane,
                                                                                         Class<T> clazz,
                                                                                         LaneBasedGTU gtu,
                                                                                         RelativePosition.TYPE pos)
                                                                                  throws GTUException
        Retrieve objects on a lane of a specific type. Returns upstream objects from the relative position for as far as the lane structure goes. Distances to upstream objects are given as positive values.
        Type Parameters:
        T - type of objects to find
        Parameters:
        lane - RelativeLane; lane
        clazz - Class<T>; class of objects to find
        gtu - LaneBasedGTU; gtu
        pos - RelativePosition.TYPE; relative position to start search from
        Returns:
        SortedSet; sorted set of objects of requested type
        Throws:
        GTUException - if lane is not in current set