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 Summary
Modifier and TypeMethodDescriptioncanPlace
(SortedSet<HeadwayGtu> leaders, LaneBasedGtuCharacteristics characteristics, org.djunits.value.vdouble.scalar.Duration since, LanePosition initialPosition) Return the maximum safe speed and position for a new GTU with the specified characteristics.
-
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. ReturnsPlacement.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 branchcharacteristics
- LaneBasedGtuCharacteristics; characteristics of the proposed new GTUsince
- Duration; time since the GTU wanted to arriveinitialPosition
- 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 structureGtuException
- on parameter exception
-