Interface LaneBasedGtuGenerator.RoomChecker

All Known Implementing Classes:
CfBaRoomChecker, CfRoomChecker, Injections, 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 Details

    • canPlace

      LaneBasedGtuGenerator.Placement canPlace(SortedSet<HeadwayGtu> leaders, LaneBasedGtuCharacteristics characteristics, org.djunits.value.vdouble.scalar.Duration since, LanePosition 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 - LanePosition; 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