Interface GtuHeadwayType
-
- All Known Implementing Classes:
DefaultCaccSensors,GtuHeadwayType.PerceivedGtuHeadwayType
public interface GtuHeadwayTypeWhether a GTU needs to be wrapped, or information should be copied for later and unaltered use.Copyright (c) 2013-2020 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 24 mrt. 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classGtuHeadwayType.PerceivedGtuHeadwayTypeClass for perceived neighbors.
-
Field Summary
Fields Modifier and Type Field Description static GtuHeadwayTypeCOPYInfo regarding the GTU is copied.static GtuHeadwayTypeWRAPThe GTU is wrapped, and info is taken directly from it.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description GtuHeadwaycreateDownstreamGtu(InternalLaneBasedGtu perceivingGtu, LaneBasedGtu perceivedGtu, Length distance)Creates a headway object from a GTU, downstream.default GtuHeadwaycreateHeadwayGtu(InternalLaneBasedGtu perceivingGtu, LaneBasedGtu perceivedGtu, Length distance, boolean downstream)Creates a headway object from a GTU, downstream or upstream.GtuHeadwaycreateParallelGtu(InternalLaneBasedGtu perceivingGtu, LaneBasedGtu perceivedGtu, Length overlapFront, Length overlap, Length overlapRear)Creates a headway object from a GTU, parallel.GtuHeadwaycreateUpstreamGtu(InternalLaneBasedGtu perceivingGtu, LaneBasedGtu perceivedGtu, Length distance)Creates a headway object from a GTU, downstream.
-
-
-
Field Detail
-
WRAP
static final GtuHeadwayType WRAP
The GTU is wrapped, and info is taken directly from it.
-
COPY
static final GtuHeadwayType COPY
Info regarding the GTU is copied.
-
-
Method Detail
-
createHeadwayGtu
default GtuHeadway createHeadwayGtu(InternalLaneBasedGtu perceivingGtu, LaneBasedGtu perceivedGtu, Length distance, boolean downstream) throws GtuException, ParameterException
Creates a headway object from a GTU, downstream or upstream. The default implementation figures out from possible negative distance whether a parallel GTU should be created.- Parameters:
perceivingGtu- InternalLaneBasedGtu; perceiving GTUperceivedGtu- LaneBasedGtu; perceived GTUdistance- Length; distancedownstream- boolean; downstream (or upstream) neighbor- Returns:
- headway object from a gtu
- Throws:
GtuException- when headway object cannot be createdParameterException- on invalid parameter value or missing parameter
-
createDownstreamGtu
GtuHeadway createDownstreamGtu(InternalLaneBasedGtu perceivingGtu, LaneBasedGtu perceivedGtu, Length distance) throws GtuException, ParameterException
Creates a headway object from a GTU, downstream.- Parameters:
perceivingGtu- InternalLaneBasedGtu; perceiving GTUperceivedGtu- LaneBasedGtu; perceived GTUdistance- Length; distance- Returns:
- headway object from a gtu
- Throws:
GtuException- when headway object cannot be createdParameterException- on invalid parameter value or missing parameter
-
createUpstreamGtu
GtuHeadway createUpstreamGtu(InternalLaneBasedGtu perceivingGtu, LaneBasedGtu perceivedGtu, Length distance) throws GtuException, ParameterException
Creates a headway object from a GTU, downstream.- Parameters:
perceivingGtu- InternalLaneBasedGtu; perceiving GTUperceivedGtu- LaneBasedGtu; perceived GTUdistance- Length; distance- Returns:
- headway object from a gtu
- Throws:
GtuException- when headway object cannot be createdParameterException- on invalid parameter value or missing parameter
-
createParallelGtu
GtuHeadway createParallelGtu(InternalLaneBasedGtu perceivingGtu, LaneBasedGtu perceivedGtu, Length overlapFront, Length overlap, Length overlapRear) throws GtuException
Creates a headway object from a GTU, parallel.- Parameters:
perceivingGtu- InternalLaneBasedGtu; perceiving GTUperceivedGtu- LaneBasedGtu; perceived GTUoverlapFront- Length; front overlapoverlap- Length; overlapoverlapRear- Length; rear overlap- Returns:
- headway object from a gtu
- Throws:
GtuException- when headway object cannot be created
-
-