public abstract class AbstractHeadway extends Object implements Headway
AbstractHeadwayCopy
(and all it's sub classes), which contains such information
directly, and is a super class for delayed and/or erroneous perception.
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
Modifier | Constructor and Description |
---|---|
|
AbstractHeadway(Length distance)
Construct a new Headway information object, for an object ahead of us or behind us.
|
|
AbstractHeadway(Length overlapFront,
Length overlap,
Length overlapRear)
Construct a new Headway information object, for an object parallel with us.
|
protected |
AbstractHeadway(Length distance,
Length overlapFront,
Length overlap,
Length overlapRear)
Construct a new Headway information object, for an object in front, behind, or in parallel with us.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Length |
getDistance()
Retrieve the strongly typed distance to the other object.
|
Length |
getOverlap()
Return the (perceived) overlap with the other object.
|
Length |
getOverlapFront()
Return the (perceived) front overlap to the other object.
|
Length |
getOverlapRear()
Return the (perceived) rear overlap to the other object.
|
int |
hashCode() |
boolean |
isAhead() |
boolean |
isBehind() |
boolean |
isParallel() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compareTo, getAcceleration, getId, getLength, getObjectType, getSpeed
protected AbstractHeadway(Length distance, Length overlapFront, Length overlap, Length overlapRear) throws GTUException
distance
- Length; the distance to the other objectoverlapFront
- Length; the front-front distance to the other objectoverlap
- Length; the 'center' overlap with the other objectoverlapRear
- Length; the rear-rear distance to the other objectGTUException
- when id is null, or parameters are inconsistentpublic AbstractHeadway(Length distance) throws GTUException
distance
- the distance to the other object; if this constructor is used, distance cannot be null.GTUException
- when id is null, or parameters are inconsistentpublic AbstractHeadway(Length overlapFront, Length overlap, Length overlapRear) throws GTUException
overlapFront
- the front-front distance to the other object; if this constructor is used, this value cannot be null.overlap
- the 'center' overlap with the other object; if this constructor is used, this value cannot be null.overlapRear
- the rear-rear distance to the other object; if this constructor is used, this value cannot be null.GTUException
- when id is null, or parameters are inconsistentpublic final Length getDistance()
getDistance
in interface Headway
public final Length getOverlapFront()
---------- | GTU 1 | -----> ---------- --------------- | GTU 2 | -----> --------------- | a | b | c |
getOverlapFront
in interface Headway
public final Length getOverlapRear()
---------- | GTU 1 | -----> ---------- --------------- | GTU 2 | -----> --------------- | a | b | c |
getOverlapRear
in interface Headway
public final Length getOverlap()
---------- | GTU 1 | -----> ---------- --------------- | GTU 2 | -----> --------------- | a | b | c |
getOverlap
in interface Headway
public final boolean isAhead()
public final boolean isBehind()
public final boolean isParallel()
isParallel
in interface Headway
Copyright © 2014–2019 Delft University of Technology. All rights reserved.