Interface LaneBasedGTUGenerator.RoomChecker

  • All Known Implementing Classes:
    CFBARoomChecker, CFRoomChecker, TTCRoomChecker
    Enclosing class:
    LaneBasedGTUGenerator

    public static interface LaneBasedGTUGenerator.RoomChecker
    Interface for class that checks that there is sufficient room for a proposed new GTU and returns the maximum safe speed and position for the proposed new GTU.
    • Method Detail

      • canPlace

        LaneBasedGTUGenerator.Placement canPlace​(SortedSet<HeadwayGTU> leaders,
                                                 LaneBasedGTUCharacteristics characteristics,
                                                 Duration since,
                                                 Set<DirectedLanePosition> initialPosition)
                                          throws NetworkException,
                                                 GTUException
        Return the maximum safe speed and position for a new GTU with the specified characteristics. Returns Placement.NO if there is no safe speed and position. This method might be called with an empty leader set such that the desired speed can be implemented.
        Parameters:
        leaders - SortedSet<HeadwayGTU>; leaders, usually 1, possibly more after a branch
        characteristics - LaneBasedGTUCharacteristics; characteristics of the proposed new GTU
        since - Duration; time since the GTU wanted to arrive
        initialPosition - Set<DirectedLanePosition>; initial position
        Returns:
        Speed; maximum safe speed, or null if a GTU with the specified characteristics cannot be placed at the current time
        Throws:
        NetworkException - this method may throw a NetworkException if it encounters an error in the network structure
        GTUException - on parameter exception