public abstract class AbstractHeadwayGTU extends AbstractHeadwayCopy 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 |
|---|
AbstractHeadwayGTU(String id,
GTUType gtuType,
Length distance,
boolean facingSameDirection,
Length length,
Length width,
Speed speed,
Acceleration acceleration,
Speed desiredSpeed,
GTUStatus... gtuStatus)
Construct a new Headway information object, for a moving GTU ahead of us or behind us.
|
AbstractHeadwayGTU(String id,
GTUType gtuType,
Length distance,
boolean facingSameDirection,
Length length,
Length width,
Speed desiredSpeed,
GTUStatus... gtuStatus)
Construct a new Headway information object, for a non-moving GTU ahead of us or behind us.
|
AbstractHeadwayGTU(String id,
GTUType gtuType,
Length overlapFront,
Length overlap,
Length overlapRear,
boolean facingSameDirection,
Length length,
Length width,
Speed speed,
Acceleration acceleration,
Speed desiredSpeed,
GTUStatus... gtuStatus)
Construct a new Headway information object, for a moving GTU parallel with us.
|
AbstractHeadwayGTU(String id,
GTUType gtuType,
Length overlapFront,
Length overlap,
Length overlapRear,
boolean facingSameDirection,
Length length,
Length width,
Speed desiredSpeed,
GTUStatus... gtuStatus)
Construct a new Headway information object, for a non-moving GTU parallel with us.
|
| Modifier and Type | Method and Description |
|---|---|
Speed |
getDesiredSpeed()
Returns the perceived desired speed of the neighbor.
|
protected GTUStatus[] |
getGtuStatus()
For subclasses that create a copy of themselves.
|
static GTUStatus[] |
getGTUStatuses(LaneBasedGTU gtu,
Time when)
Collects GTU statuses from a gtu.
|
GTUType |
getGtuType() |
static SpeedLimitInfo |
getSpeedLimitInfo(LaneBasedGTU gtu)
Creates speed limit info for given GTU.
|
Length |
getWidth()
Returns the width of the GTU.
|
boolean |
isBrakingLightsOn() |
boolean |
isEmergencyLightsOn() |
boolean |
isFacingSameDirection() |
boolean |
isHonking() |
boolean |
isLeftTurnIndicatorOn() |
boolean |
isRightTurnIndicatorOn() |
String |
toString() |
equals, getAcceleration, getId, getLength, getObjectType, getSpeed, hashCodegetDistance, getOverlap, getOverlapFront, getOverlapRear, isAhead, isBehind, isParallelclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetCarFollowingModel, getParameters, getRoute, getSpeedLimitInfo, movedcompareTo, getAcceleration, getDistance, getId, getLength, getObjectType, getOverlap, getOverlapFront, getOverlapRear, getSpeed, isAhead, isBehind, isParallelpublic AbstractHeadwayGTU(String id, GTUType gtuType, Length distance, boolean facingSameDirection, Length length, Length width, Speed speed, Acceleration acceleration, Speed desiredSpeed, GTUStatus... gtuStatus) throws GTUException
id - String; the id of the GTU for comparison purposes, can not be null.gtuType - GTUType; the perceived GTU Type, or null if unknown.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.length - the (perceived) length of the other object; can not be null.width - the (perceived) width of the other object; can not be null.speed - the (perceived) speed of the other object; can be null if unknown.acceleration - the (perceived) acceleration of the other object; can be null if unknown.desiredSpeed - Speed; desired speedgtuStatus - GTUStatus...; the observable characteristics of the GTU.GTUException - when id is null, objectType is null, or parameters are inconsistentpublic AbstractHeadwayGTU(String id, GTUType gtuType, Length distance, boolean facingSameDirection, Length length, Length width, Speed desiredSpeed, GTUStatus... gtuStatus) throws GTUException
id - String; the id of the GTU for comparison purposes, can not be null.gtuType - GTUType; the perceived GTU Type, or null if unknown.distance - Length; the distance to the other GTU; if this constructor is used, distance cannot be null.facingSameDirection - boolean; whether the GTU is facing the same direction.length - the (perceived) length of the other object; can not be null.width - the (perceived) width of the other object; can not be null.desiredSpeed - Speed; desired speedgtuStatus - GTUStatus...; the observable characteristics of the GTU.GTUException - when id is null, or parameters are inconsistentpublic AbstractHeadwayGTU(String id, GTUType gtuType, Length overlapFront, Length overlap, Length overlapRear, boolean facingSameDirection, Length length, Length width, Speed speed, Acceleration acceleration, Speed desiredSpeed, GTUStatus... gtuStatus) throws GTUException
id - String; the id of the GTU for comparison purposes, can not be null.gtuType - GTUType; the perceived GTU Type, or null if unknown.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.length - the (perceived) length of the other object; can not be null.width - the (perceived) width of the other object; can not be null.speed - the (perceived) speed of the other GTU; can be null if unknown.acceleration - the (perceived) acceleration of the other GTU; can be null if unknown.desiredSpeed - Speed; desired speedgtuStatus - GTUStatus...; the observable characteristics of the GTU.GTUException - when id is null, or parameters are inconsistentpublic AbstractHeadwayGTU(String id, GTUType gtuType, Length overlapFront, Length overlap, Length overlapRear, boolean facingSameDirection, Length length, Length width, Speed desiredSpeed, GTUStatus... gtuStatus) throws GTUException
id - String; the id of the GTU for comparison purposes, can not be null.gtuType - GTUType; the perceived GTU Type, or null if unknown.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.length - the (perceived) length of the other object; can not be null.width - the (perceived) width of the other object; can not be null.desiredSpeed - Speed; desired speedgtuStatus - GTUStatus...; the observable characteristics of the GTU.GTUException - when id is null, or parameters are inconsistentpublic final GTUType getGtuType()
getGtuType in interface HeadwayGTUpublic final Speed getDesiredSpeed()
getDesiredSpeed 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 HeadwayGTUprotected final GTUStatus[] getGtuStatus()
public static final GTUStatus[] getGTUStatuses(LaneBasedGTU gtu, Time when)
gtu - LaneBasedGTU; gtuwhen - Time; timepublic static SpeedLimitInfo getSpeedLimitInfo(LaneBasedGTU gtu)
gtu - LaneBasedGTU; gtu to the the speed limit info forpublic Length getWidth()
getWidth in interface HeadwayGTUpublic String toString()
toString in class AbstractHeadwayCopyright © 2014–2019 Delft University of Technology. All rights reserved.