Class TTCRoomChecker

    • Constructor Detail

      • TTCRoomChecker

        public TTCRoomChecker​(Duration ttc)
        Constructor.
        Parameters:
        ttc - Duration; time to collision
    • Method Detail

      • canPlace

        public final 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.
        Specified by:
        canPlace in interface LaneBasedGTUGenerator.RoomChecker
        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
      • getTtc

        public final Duration getTtc()
        Returns the TTC value.
        Returns:
        Duration; TTC value