Interface HeadwayGtuType
-
- All Known Implementing Classes:
DefaultCaccSensors
,HeadwayGtuType.PerceivedHeadwayGtuType
public interface HeadwayGtuType
Whether a GTU needs to be wrapped, or information should be copied for later and unaltered use.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 24 mrt. 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
HeadwayGtuType.PerceivedHeadwayGtuType
Class for perceived neighbors.
-
Field Summary
Fields Modifier and Type Field Description static HeadwayGtuType
COPY
Info regarding the GTU is copied.static HeadwayGtuType
WRAP
The 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 HeadwayGTU
createDownstreamGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length distance)
Creates a headway object from a GTU, downstream.default HeadwayGTU
createHeadwayGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length distance, boolean downstream)
Creates a headway object from a GTU, downstream or upstream.HeadwayGTU
createParallelGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length overlapFront, Length overlap, Length overlapRear)
Creates a headway object from a GTU, parallel.HeadwayGTU
createUpstreamGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length distance)
Creates a headway object from a GTU, downstream.
-
-
-
Field Detail
-
WRAP
static final HeadwayGtuType WRAP
The GTU is wrapped, and info is taken directly from it.
-
COPY
static final HeadwayGtuType COPY
Info regarding the GTU is copied.
-
-
Method Detail
-
createHeadwayGtu
default HeadwayGTU createHeadwayGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length distance, boolean downstream) throws GTUException, org.opentrafficsim.base.parameters.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
- LaneBasedGTU; 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 createdorg.opentrafficsim.base.parameters.ParameterException
- on invalid parameter value or missing parameter
-
createDownstreamGtu
HeadwayGTU createDownstreamGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length distance) throws GTUException, org.opentrafficsim.base.parameters.ParameterException
Creates a headway object from a GTU, downstream.- Parameters:
perceivingGtu
- LaneBasedGTU; perceiving GTUperceivedGtu
- LaneBasedGTU; perceived GTUdistance
- Length; distance- Returns:
- headway object from a gtu
- Throws:
GTUException
- when headway object cannot be createdorg.opentrafficsim.base.parameters.ParameterException
- on invalid parameter value or missing parameter
-
createUpstreamGtu
HeadwayGTU createUpstreamGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length distance) throws GTUException, org.opentrafficsim.base.parameters.ParameterException
Creates a headway object from a GTU, downstream.- Parameters:
perceivingGtu
- LaneBasedGTU; perceiving GTUperceivedGtu
- LaneBasedGTU; perceived GTUdistance
- Length; distance- Returns:
- headway object from a gtu
- Throws:
GTUException
- when headway object cannot be createdorg.opentrafficsim.base.parameters.ParameterException
- on invalid parameter value or missing parameter
-
createParallelGtu
HeadwayGTU createParallelGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length overlapFront, Length overlap, Length overlapRear) throws GTUException
Creates a headway object from a GTU, parallel.- Parameters:
perceivingGtu
- LaneBasedGTU; 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
-
-