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