public class CFRoomChecker extends Object implements LaneBasedGTUGenerator.RoomChecker
Copyright (c) 2013-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
CFRoomChecker() |
Modifier and Type | Method and Description |
---|---|
LaneBasedGTUGenerator.Placement |
canPlace(SortedSet<HeadwayGTU> leaders,
LaneBasedGTUCharacteristics characteristics,
Duration since,
Set<DirectedLanePosition> initialPosition)
Return the maximum safe speed and position for a new GTU with the specified characteristics.
|
protected double |
headwayFactor(Speed desiredSpeed,
Length desiredHeadway,
Speed generationSpeed,
Length generationHeadway,
Length leaderLength)
Returns a situation dependent headway factor to deal with spillback.
|
public LaneBasedGTUGenerator.Placement canPlace(SortedSet<HeadwayGTU> leaders, LaneBasedGTUCharacteristics characteristics, Duration since, Set<DirectedLanePosition> initialPosition) throws NetworkException, GTUException
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.canPlace
in interface LaneBasedGTUGenerator.RoomChecker
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
- Set<DirectedLanePosition>; initial positionNetworkException
- this method may throw a NetworkException if it encounters an error in the network structureGTUException
- on parameter exceptionprotected double headwayFactor(Speed desiredSpeed, Length desiredHeadway, Speed generationSpeed, Length generationHeadway, Length leaderLength)
desiredSpeed
- Speed; desired speeddesiredHeadway
- Length; desired headway at desired speedgenerationSpeed
- Speed; generation speedgenerationHeadway
- Length; desired headway at generation speedleaderLength
- Length; length of the leaderCopyright © 2014–2018 Delft University of Technology. All rights reserved.