package org.opentrafficsim.road.gtu.generator; import java.util.Set; import java.util.SortedSet; import org.djunits.unit.DurationUnit; import org.djunits.unit.LengthUnit; import org.djunits.value.vdouble.scalar.Duration; import org.djunits.value.vdouble.scalar.Length; import org.djunits.value.vdouble.scalar.Speed; import org.opentrafficsim.core.gtu.GTUException; import org.opentrafficsim.core.network.NetworkException; import org.opentrafficsim.road.gtu.generator.LaneBasedGTUGenerator.Placement; import org.opentrafficsim.road.gtu.generator.LaneBasedGTUGenerator.RoomChecker; import org.opentrafficsim.road.gtu.generator.characteristics.LaneBasedGTUCharacteristics; import org.opentrafficsim.road.gtu.lane.perception.headway.HeadwayGTU; import org.opentrafficsim.road.network.lane.DirectedLanePosition; /** * Room checker based on time-to-collision. The room is considered ok if: *
* Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
* BSD-style license. See OpenTrafficSim License.
*
* @version $Revision$, $LastChangedDate$, by $Author$, initial version 17 nov. 2016
* @author Alexander Verbraeck
* @author Peter Knoppers
* @author Wouter Schakel
*/
public class TTCRoomChecker implements RoomChecker
{
/** Time to collision. */
private final Duration ttc;
/**
* Constructor.
* @param ttc Duration; time to collision
*/
public TTCRoomChecker(final Duration ttc)
{
this.ttc = ttc;
}
/** {@inheritDoc} */
@Override
public final Placement canPlace(final SortedSet