public class HeadwayGTUReal extends AbstractHeadway implements HeadwayGTU
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.
Headway.ObjectType
Constructor and Description |
---|
HeadwayGTUReal(LaneBasedGTU gtu,
Length distance,
boolean facingSameDirection)
Construct a new Headway information object, for a GTU ahead of us or behind us.
|
HeadwayGTUReal(LaneBasedGTU gtu,
Length overlapFront,
Length overlap,
Length overlapRear,
boolean facingSameDirection)
Construct a new Headway information object, for a GTU parallel with us.
|
Modifier and Type | Method and Description |
---|---|
Acceleration |
getAcceleration() |
CarFollowingModel |
getCarFollowingModel()
Many models that observe a GTU need to predict the imminent behavior of that GTU.
|
Speed |
getDesiredSpeed()
Returns the perceived desired speed of the neighbor.
|
GTUType |
getGtuType() |
String |
getId() |
Length |
getLength() |
Headway.ObjectType |
getObjectType() |
Parameters |
getParameters()
Many models that observe a GTU need to predict the imminent behavior of that GTU.
|
Route |
getRoute()
Models responding to other GTU may assume a route of the vehicle, for instance at intersections.
|
Speed |
getSpeed() |
SpeedLimitInfo |
getSpeedLimitInfo()
Many models that observe a GTU need to predict the imminent behavior of that GTU.
|
Length |
getWidth()
Returns the width of the GTU.
|
boolean |
isBrakingLightsOn() |
boolean |
isEmergencyLightsOn() |
boolean |
isFacingSameDirection() |
boolean |
isHonking() |
boolean |
isLeftTurnIndicatorOn() |
boolean |
isRightTurnIndicatorOn() |
HeadwayGTU |
moved(Length headway,
Speed speed,
Acceleration acceleration)
Creates a copy with different headway, speed and possibly acceleration.
|
String |
toString() |
equals, getDistance, getOverlap, getOverlapFront, getOverlapRear, hashCode, isAhead, isBehind, isParallel
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compareTo, getDistance, getOverlap, getOverlapFront, getOverlapRear, isAhead, isBehind, isParallel
public HeadwayGTUReal(LaneBasedGTU gtu, Length distance, boolean facingSameDirection) throws GTUException
gtu
- the observed GTU, can not be null.distance
- the distance to the other object; if this constructor is used, distance cannot be null.facingSameDirection
- whether the GTU is facing the same direction.GTUException
- when id is null, objectType is null, or parameters are inconsistentpublic HeadwayGTUReal(LaneBasedGTU gtu, Length overlapFront, Length overlap, Length overlapRear, boolean facingSameDirection) throws GTUException
gtu
- the observed GTU, can not be null.overlapFront
- the front-front distance to the other GTU; if this constructor is used, this value cannot be null.overlap
- the 'center' overlap with the other GTU; if this constructor is used, this value cannot be null.overlapRear
- the rear-rear distance to the other GTU; if this constructor is used, this value cannot be null.facingSameDirection
- whether the GTU is facing the same direction.GTUException
- when id is null, or parameters are inconsistentpublic final CarFollowingModel getCarFollowingModel()
getCarFollowingModel
in interface HeadwayGTU
public final Parameters getParameters()
getParameters
in interface HeadwayGTU
public final SpeedLimitInfo getSpeedLimitInfo()
getSpeedLimitInfo
in interface HeadwayGTU
public final Route getRoute()
null
if simply not known/estimated.getRoute
in interface HeadwayGTU
public final HeadwayGTU moved(Length headway, Speed speed, Acceleration acceleration)
HeadwayGTURealDirect
, only headway, speed and acceleration may be considered to be delayed
and anticipated. Other information is taken from the actual GTU at the time moved()
is called.moved
in interface HeadwayGTU
headway
- headwayspeed
- speedacceleration
- accelerationpublic final String getId()
getId
in interface Identifiable
getId
in interface Headway
public final Length getLength()
public Length getWidth()
getWidth
in interface HeadwayGTU
public final Speed getSpeed()
public Speed getDesiredSpeed()
getDesiredSpeed
in interface HeadwayGTU
public final Headway.ObjectType getObjectType()
getObjectType
in interface Headway
public final Acceleration getAcceleration()
getAcceleration
in interface Headway
public final GTUType getGtuType()
getGtuType
in interface HeadwayGTU
public final boolean isFacingSameDirection()
isFacingSameDirection
in interface HeadwayGTU
public final boolean isBrakingLightsOn()
isBrakingLightsOn
in interface HeadwayGTU
public final boolean isLeftTurnIndicatorOn()
isLeftTurnIndicatorOn
in interface HeadwayGTU
public final boolean isRightTurnIndicatorOn()
isRightTurnIndicatorOn
in interface HeadwayGTU
public final boolean isEmergencyLightsOn()
isEmergencyLightsOn
in interface HeadwayGTU
public final boolean isHonking()
isHonking
in interface HeadwayGTU
public final String toString()
toString
in class AbstractHeadway
Copyright © 2014–2018 Delft University of Technology. All rights reserved.