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 nl.tudelft.simulation.event.EventType |
LANE_CHANGE_EVENT
The event type for pub/sub indicating that the GTU change lane.
|
static nl.tudelft.simulation.event.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 nl.tudelft.simulation.event.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 nl.tudelft.simulation.event.EventType |
LANEBASED_DESTROY_EVENT
The lane-based event type for pub/sub indicating destruction of the GTU.
|
static nl.tudelft.simulation.event.EventType |
LANEBASED_INIT_EVENT
The lane-based event type for pub/sub indicating the initialization of a new GTU.
|
static nl.tudelft.simulation.event.EventType |
LANEBASED_MOVE_EVENT
The lane-based event type for pub/sub indicating a move.
|
static nl.tudelft.simulation.event.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 nl.tudelft.simulation.event.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
Modifier and Type | Method and Description |
---|---|
void |
addTrigger(Lane lane,
nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEventInterface<nl.tudelft.simulation.dsol.simtime.SimTimeDoubleUnit> event)
Add an event to the list of lane triggers scheduled for this GTU.
|
void |
changeLaneInstantaneously(LateralDirectionality laneChangeDirection)
Change lanes instantaneously.
|
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.
|
Length |
getLateralPosition(Lane lane)
Returns the lateral position of the GTU relative to the lane center line.
|
nl.tudelft.simulation.language.d3.DirectedPoint |
getLocation()
Return the location without a RemoteException.
|
RoadNetwork |
getNetwork() |
default Length |
getProjectedLength(Lane lane)
Get projected length on the lane.
|
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.
|
void |
initLaneChange(LateralDirectionality laneChangeDirection)
Register on lanes in target lane.
|
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 |
isInstantaneousLaneChange()
Returns whether the GTU perform lane changes instantaneously or not.
|
boolean |
laneChangeAllowed()
Returns whether a lane change is allowed.
|
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.
|
void |
setFinalizeLaneChangeEvent(nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEventInterface<nl.tudelft.simulation.dsol.simtime.SimTimeDoubleUnit> event)
Sets event to finalize lane change.
|
void |
setInstantaneousLaneChange(boolean instantaneous)
Sets whether the GTU perform lane changes instantaneously or not.
|
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.
|
addGtu, destroy, getAcceleration, getAcceleration, getCenter, getChildren, getContourPoints, getFront, getGTUType, getId, getLength, getMaximumAcceleration, getMaximumDeceleration, getMaximumSpeed, getOdometer, getOdometer, getOperationalPlan, getOperationalPlan, getParameters, getParent, getPerceivableContext, getRear, getReference, getRelativePositions, getSimulator, getSpeed, getSpeed, getWidth, isDestroyed, removeGtu, setErrorHandler, setParameters, setParent
static final nl.tudelft.simulation.event.EventType LANEBASED_INIT_EVENT
static final nl.tudelft.simulation.event.EventType LANEBASED_MOVE_EVENT
static final nl.tudelft.simulation.event.EventType LANEBASED_DESTROY_EVENT
static final nl.tudelft.simulation.event.EventType LINK_ENTER_EVENT
static final nl.tudelft.simulation.event.EventType LINK_EXIT_EVENT
static final nl.tudelft.simulation.event.EventType LANE_ENTER_EVENT
static final nl.tudelft.simulation.event.EventType LANE_EXIT_EVENT
static final nl.tudelft.simulation.event.EventType LANE_CHANGE_EVENT
RoadNetwork getNetwork()
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
nl.tudelft.simulation.language.d3.DirectedPoint getLocation()
getLocation
in interface nl.tudelft.simulation.dsol.animation.Locatable
void changeLaneInstantaneously(LateralDirectionality laneChangeDirection) throws GTUException
laneChangeDirection
- LateralDirectionality; the direction to change toGTUException
- in case lane change failsvoid initLaneChange(LateralDirectionality laneChangeDirection) throws GTUException
laneChangeDirection
- LateralDirectionality; direction of lane changeGTUException
- exceptionvoid setFinalizeLaneChangeEvent(nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEventInterface<nl.tudelft.simulation.dsol.simtime.SimTimeDoubleUnit> event)
event
- SimEventInterface<SimTimeDoubleUnit>; eventdefault Length getProjectedLength(Lane lane) throws GTUException
lane
- Lane; lane to project the vehicle onGTUException
- when the vehicle is not on the given lanevoid setInstantaneousLaneChange(boolean instantaneous)
instantaneous
- boolean; whether the GTU perform lane changes instantaneously or notboolean isInstantaneousLaneChange()
Map<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.DirectedLanePosition 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, nl.tudelft.simulation.dsol.formalisms.eventscheduling.SimEventInterface<nl.tudelft.simulation.dsol.simtime.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; timeLength getLateralPosition(Lane lane) throws GTUException
lane
- Lane; lane to consider (most important regarding left/right, not upstream downstream)GTUException
- when the vehicle is not on the given lane.TurnIndicatorStatus 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.