public class HeadwayGTUReal extends AbstractHeadway implements HeadwayGTU
Copyright (c) 2013-2019 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, isParallelclone, finalize, getClass, notify, notifyAll, wait, wait, waitcompareTo, getDistance, getOverlap, getOverlapFront, getOverlapRear, isAhead, isBehind, isParallelpublic HeadwayGTUReal(LaneBasedGTU gtu, Length distance, boolean facingSameDirection) throws GTUException
gtu - LaneBasedGTU; the observed GTU, can not be null.distance - the distance to the other object; if this constructor is used, distance cannot be null.facingSameDirection - boolean; 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 - LaneBasedGTU; 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 - boolean; whether the GTU is facing the same direction.GTUException - when id is null, or parameters are inconsistentpublic final CarFollowingModel getCarFollowingModel()
getCarFollowingModel in interface HeadwayGTUpublic final Parameters getParameters()
getParameters in interface HeadwayGTUpublic final SpeedLimitInfo getSpeedLimitInfo()
getSpeedLimitInfo in interface HeadwayGTUpublic final Route getRoute()
null if simply not known/estimated.getRoute in interface HeadwayGTUpublic 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 HeadwayGTUheadway - Length; headwayspeed - Speed; speedacceleration - Acceleration; accelerationpublic final String getId()
getId in interface IdentifiablegetId in interface Headwaypublic final Length getLength()
public Length getWidth()
getWidth in interface HeadwayGTUpublic final Speed getSpeed()
public Speed getDesiredSpeed()
getDesiredSpeed in interface HeadwayGTUpublic final Headway.ObjectType getObjectType()
getObjectType in interface Headwaypublic final Acceleration getAcceleration()
getAcceleration in interface Headwaypublic final GTUType getGtuType()
getGtuType in interface HeadwayGTUpublic final boolean isFacingSameDirection()
isFacingSameDirection in interface HeadwayGTUpublic final boolean isBrakingLightsOn()
isBrakingLightsOn in interface HeadwayGTUpublic final boolean isLeftTurnIndicatorOn()
isLeftTurnIndicatorOn in interface HeadwayGTUpublic final boolean isRightTurnIndicatorOn()
isRightTurnIndicatorOn in interface HeadwayGTUpublic final boolean isEmergencyLightsOn()
isEmergencyLightsOn in interface HeadwayGTUpublic final boolean isHonking()
isHonking in interface HeadwayGTUpublic final String toString()
toString in class AbstractHeadwayCopyright © 2014–2019 Delft University of Technology. All rights reserved.