public interface LaneBasedGTU extends GTU
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.
Modifier and Type | Field and Description |
---|---|
static EventType |
LANE_CHANGE_EVENT
The event type for pub/sub indicating that the GTU change lane.
|
static EventType |
LANE_ENTER_EVENT
The event type for pub/sub indicating that the GTU entered a new lane (with the FRONT position if driving forward; REAR
if driving backward).
|
static EventType |
LANE_EXIT_EVENT
The event type for pub/sub indicating that the GTU exited a lane (with the REAR position if driving forward; FRONT if
driving backward).
|
static EventType |
LANEBASED_DESTROY_EVENT
The lane-based event type for pub/sub indicating destruction of the GTU.
|
static EventType |
LANEBASED_INIT_EVENT
The lane-based event type for pub/sub indicating the initialization of a new GTU.
|
static EventType |
LANEBASED_MOVE_EVENT
The lane-based event type for pub/sub indicating a move.
|
static EventType |
LINK_ENTER_EVENT
The event type for pub/sub indicating that the GTU entered a new link (with the FRONT position if driving forward; REAR
if driving backward).
|
static EventType |
LINK_EXIT_EVENT
The event type for pub/sub indicating that the GTU exited a link (with the REAR position if driving forward; FRONT if
driving backward).
|
DESTROY_EVENT, INIT_EVENT, MOVE_EVENT
FIRST_POSITION, LAST_POSITION
Modifier and Type | Method and Description |
---|---|
void |
addTrigger(Lane lane,
SimEventInterface<SimTimeDoubleUnit> event)
Add an event to the list of lane triggers scheduled for this GTU.
|
void |
changeLaneInstantaneously(LateralDirectionality laneChangeDirection)
Change lanes instantaneously.
|
void |
enterLane(Lane lane,
Length position,
GTUDirectionality gtuDirection)
insert GTU at a certain position.
|
double |
fractionalPosition(Lane lane,
RelativePosition relativePosition)
Return the longitudinal position of a point relative to this GTU, relative to the center line of the Lane, as a fraction
of the length of the lane.
|
double |
fractionalPosition(Lane lane,
RelativePosition relativePosition,
Time when)
Return the longitudinal position of a point relative to this GTU, relative to the center line of the Lane, as a fraction
of the length of the lane.
|
Map<Lane,Double> |
fractionalPositions(RelativePosition relativePosition)
Return the longitudinal positions of a point relative to this GTU, relative to the center line of the Lanes in which the
vehicle is registered, as fractions of the length of the lane.
|
Map<Lane,Double> |
fractionalPositions(RelativePosition relativePosition,
Time when)
Return the longitudinal positions of a point relative to this GTU, relative to the center line of the Lanes in which the
vehicle is registered, as fractions of the length of the lane.
|
Acceleration |
getCarFollowingAcceleration()
This method returns the current car-following acceleration of the GTU.
|
Speed |
getDesiredSpeed()
This method returns the current desired speed of the GTU.
|
GTUDirectionality |
getDirection(Lane lane)
Return the directionality of a lane on which the GTU is registered for its current operational plan.
|
DirectedPoint |
getLocation()
Return the location without a RemoteException.
|
DirectedLanePosition |
getReferencePosition()
Return the current Lane, position and directionality of the GTU.
|
LaneBasedStrategicalPlanner |
getStrategicalPlanner() |
LaneBasedStrategicalPlanner |
getStrategicalPlanner(Time time) |
default LaneBasedTacticalPlanner |
getTacticalPlanner() |
default LaneBasedTacticalPlanner |
getTacticalPlanner(Time time) |
TurnIndicatorStatus |
getTurnIndicatorStatus() |
TurnIndicatorStatus |
getTurnIndicatorStatus(Time time) |
default VehicleModel |
getVehicleModel()
Returns the vehicle model.
|
default boolean |
isBrakingLightsOn()
The default implementation returns
true if the deceleration is larger than a speed-dependent threshold given
by:c0 * g(v) + c1 + c3*v^2 where c0 = 0.2, c1 = 0.15 and c3 = 0.00025 (with c2 = 0 implicit) are empirically derived averages, and g(v) is 0 below 25 km/h or 1 otherwise, representing that the engine is disengaged at low speeds. |
default boolean |
isBrakingLightsOn(Time when)
The default implementation returns
true if the deceleration is larger than a speed-dependent threshold given
by:c0 * g(v) + c1 + c3*v^2 where c0 = 0.2, c1 = 0.15 and c3 = 0.00025 (with c2 = 0 implicit) are empirically derived averages, and g(v) is 0 below 25 km/h or 1 otherwise, representing that the engine is disengaged at low speeds. |
boolean |
laneChangeAllowed()
Returns whether a lane change is allowed.
|
void |
leaveLane(Lane lane)
Unregister the GTU from a lane.
|
Length |
position(Lane lane,
RelativePosition relativePosition)
Return the longitudinal position of a point relative to this GTU, relative to the center line of the Lane at the current
simulation time.
|
Length |
position(Lane lane,
RelativePosition relativePosition,
Time when)
Return the longitudinal position of a point relative to this GTU, relative to the center line of the Lane.
|
Map<Lane,Length> |
positions(RelativePosition relativePosition)
Return the longitudinal positions of a point relative to this GTU, relative to the center line of the Lanes in which the
vehicle is registered.
|
Map<Lane,Length> |
positions(RelativePosition relativePosition,
Time when)
Return the longitudinal positions of a point relative to this GTU, relative to the center line of the Lanes in which the
vehicle is registered.
|
Length |
projectedPosition(Lane projectionLane,
RelativePosition relativePosition,
Time when)
Return the longitudinal position on the projection lane that has the same fractional position on one of the current lanes
of the indicated relative position.
|
void |
setFinalizeLaneChangeEvent(SimEventInterface<SimTimeDoubleUnit> event)
Sets event to finalize lane change.
|
void |
setNoLaneChangeDistance(Length distance)
Set distance over which the GTU should not change lane after being created.
|
void |
setTurnIndicatorStatus(TurnIndicatorStatus turnIndicatorStatus)
Set the status of the turn indicator.
|
Length |
translatedPosition(Lane projectionLane,
RelativePosition relativePosition,
Time when)
Return the longitudinal position that the indicated relative position of this GTU would have if it were to change to
another Lane with a / the current CrossSectionLink.
|
addGtu, destroy, getAcceleration, getAcceleration, getCenter, getChildren, getContourPoints, getFront, getGTUType, getId, getLength, getMaximumAcceleration, getMaximumDeceleration, getMaximumSpeed, getOdometer, getOdometer, getOperationalPlan, getOperationalPlan, getParameters, getParent, getRear, getReference, getRelativePositions, getSimulator, getSpeed, getSpeed, getWidth, isDestroyed, removeGtu, setParameters, setParent
addListener, addListener, addListener, addListener, removeListener
static final EventType LANEBASED_INIT_EVENT
static final EventType LANEBASED_MOVE_EVENT
static final EventType LANEBASED_DESTROY_EVENT
static final EventType LINK_ENTER_EVENT
static final EventType LINK_EXIT_EVENT
static final EventType LANE_ENTER_EVENT
static final EventType LANE_EXIT_EVENT
static final EventType LANE_CHANGE_EVENT
LaneBasedStrategicalPlanner getStrategicalPlanner()
getStrategicalPlanner
in interface GTU
LaneBasedStrategicalPlanner getStrategicalPlanner(Time time)
getStrategicalPlanner
in interface GTU
default LaneBasedTacticalPlanner getTacticalPlanner()
getTacticalPlanner
in interface GTU
default LaneBasedTacticalPlanner getTacticalPlanner(Time time)
getTacticalPlanner
in interface GTU
DirectedPoint getLocation()
getLocation
in interface Locatable
void enterLane(Lane lane, Length position, GTUDirectionality gtuDirection) throws GTUException
lane
- Lane; the lane to add to the list of lanes on which the GTU is registered.gtuDirection
- GTUDirectionality; the direction of the GTU on the lane (which can be bidirectional). If the GTU has
a positive speed, it is moving in this direction.position
- Length; the position on the lane.GTUException
- when positioning the GTU on the lane causes a problemvoid leaveLane(Lane lane) throws GTUException
lane
- Lane; the lane to remove from the list of lanes on which the GTU is registered.GTUException
- when leaveLane should not be calledvoid changeLaneInstantaneously(LateralDirectionality laneChangeDirection) throws GTUException
laneChangeDirection
- LateralDirectionality; the direction to change toGTUException
- in case lane change failsvoid setFinalizeLaneChangeEvent(SimEventInterface<SimTimeDoubleUnit> event)
event
- SimEventInterface<SimTimeDoubleUnit>; eventMap<Lane,Length> positions(RelativePosition relativePosition) throws GTUException
relativePosition
- RelativePosition; the position on the vehicle relative to the reference point.GTUException
- when the vehicle is not on one of the lanes on which it is registered.Map<Lane,Length> positions(RelativePosition relativePosition, Time when) throws GTUException
relativePosition
- RelativePosition; the position on the vehicle relative to the reference point.when
- Time; the future time for which to calculate the positions.GTUException
- when the vehicle is not on one of the lanes on which it is registered.Length position(Lane lane, RelativePosition relativePosition) throws GTUException
lane
- Lane; the position on this lane will be returned.relativePosition
- RelativePosition; the position on the vehicle relative to the reference point.GTUException
- when the vehicle is not on the given lane.Length position(Lane lane, RelativePosition relativePosition, Time when) throws GTUException
lane
- Lane; the position on this lane will be returned.relativePosition
- RelativePosition; the position on the vehicle relative to the reference point.when
- Time; the future time for which to calculate the positions.GTUException
- when the vehicle is not on the given lane.Map<Lane,Double> fractionalPositions(RelativePosition relativePosition) throws GTUException
relativePosition
- RelativePosition; the position on the vehicle relative to the reference point.GTUException
- when the vehicle is not on one of the lanes on which it is registered.Map<Lane,Double> fractionalPositions(RelativePosition relativePosition, Time when) throws GTUException
relativePosition
- RelativePosition; the position on the vehicle relative to the reference point.when
- Time; the future time for which to calculate the positions.GTUException
- when the vehicle is not on one of the lanes on which it is registered.double fractionalPosition(Lane lane, RelativePosition relativePosition, Time when) throws GTUException
lane
- Lane; the position on this lane will be returned.relativePosition
- RelativePosition; the position on the vehicle relative to the reference point.when
- Time; the future time for which to calculate the positions.GTUException
- when the vehicle is not on the given lane.double fractionalPosition(Lane lane, RelativePosition relativePosition) throws GTUException
lane
- Lane; the position on this lane will be returned.relativePosition
- RelativePosition; the position on the vehicle relative to the reference point.GTUException
- when the vehicle is not on the given lane.Length translatedPosition(Lane projectionLane, RelativePosition relativePosition, Time when) throws GTUException
projectionLane
- Lane; the lane onto which the position of this GTU must be projectedrelativePosition
- RelativePosition; the point on this GTU that must be projectedwhen
- Time; the time for which to project the position of this GTUGTUException
- when projectionLane it not in any of the CrossSectionLink that the GTU is onLength projectedPosition(Lane projectionLane, RelativePosition relativePosition, Time when) throws GTUException
projectionLane
- Lane; the lane onto which the position of this GTU must be projectedrelativePosition
- RelativePosition; the point on this GTU that must be projectedwhen
- Time; the time for which to project the position of this GTUGTUException
- when projectionLane it not in any of the CrossSectionLink that the GTU is onDirectedLanePosition getReferencePosition() throws GTUException
GTUException
- in case the reference position of the GTU cannot be found on the lanes in its current pathGTUDirectionality getDirection(Lane lane) throws GTUException
lane
- Lane; the lane for which we want to know the directionGTUException
- in case the GTU is not registered on the Lanevoid addTrigger(Lane lane, SimEventInterface<SimTimeDoubleUnit> event)
lane
- Lane; the lane on which the event occursevent
- SimEventInterface<SimTimeDoubleUnit>; SimeEvent<SimTimeDoubleUnit> the eventvoid setNoLaneChangeDistance(Length distance)
distance
- Length; distance over which the GTU should not change lane after being createdboolean laneChangeAllowed()
Speed getDesiredSpeed()
Acceleration getCarFollowingAcceleration()
default VehicleModel getVehicleModel()
default boolean isBrakingLightsOn()
true
if the deceleration is larger than a speed-dependent threshold given
by:default boolean isBrakingLightsOn(Time when)
true
if the deceleration is larger than a speed-dependent threshold given
by:when
- Time; timeTurnIndicatorStatus getTurnIndicatorStatus()
TurnIndicatorStatus getTurnIndicatorStatus(Time time)
time
- Time; time to obtain the turn indicator status atvoid setTurnIndicatorStatus(TurnIndicatorStatus turnIndicatorStatus) throws GTUException
turnIndicatorStatus
- TurnIndicatorStatus; the new status of the turn indicator.GTUException
- when GTUType does not have a turn indicatorCopyright © 2014–2019 Delft University of Technology. All rights reserved.