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-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 classHeadwayGtuType.PerceivedHeadwayGtuTypeClass for perceived neighbors. -
Field Summary
Fields Modifier and Type Field Description static HeadwayGtuTypeCOPYInfo regarding the GTU is copied.static HeadwayGtuTypeWRAPThe GTU is wrapped, and info is taken directly from it. -
Method Summary
Modifier and Type Method Description HeadwayGTUcreateDownstreamGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length distance)Creates a headway object from a GTU, downstream.default HeadwayGTUcreateHeadwayGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length distance, boolean downstream)Creates a headway object from a GTU, downstream or upstream.HeadwayGTUcreateParallelGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length overlapFront, Length overlap, Length overlapRear)Creates a headway object from a GTU, parallel.HeadwayGTUcreateUpstreamGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length distance)Creates a headway object from a GTU, downstream.
-
Field Details
-
Method Details
-
createHeadwayGtu
default HeadwayGTU createHeadwayGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length distance, boolean downstream) throws GTUException, ParameterExceptionCreates 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 createdParameterException- on invalid parameter value or missing parameter
-
createDownstreamGtu
HeadwayGTU createDownstreamGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length distance) throws GTUException, ParameterExceptionCreates 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 createdParameterException- on invalid parameter value or missing parameter
-
createUpstreamGtu
HeadwayGTU createUpstreamGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length distance) throws GTUException, ParameterExceptionCreates 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 createdParameterException- on invalid parameter value or missing parameter
-
createParallelGtu
HeadwayGTU createParallelGtu(LaneBasedGTU perceivingGtu, LaneBasedGTU perceivedGtu, Length overlapFront, Length overlap, Length overlapRear) throws GTUExceptionCreates 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
-