public interface LaneBasedGTU
extends org.opentrafficsim.core.gtu.GTU
Copyright (c) 2013-2018 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).
|
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(org.opentrafficsim.core.network.LateralDirectionality laneChangeDirection)
Change lanes instantaneously.
|
void |
enterLane(Lane lane,
org.djunits.value.vdouble.scalar.Length position,
org.opentrafficsim.core.gtu.GTUDirectionality gtuDirection)
insert GTU at a certain position.
|
double |
fractionalPosition(Lane lane,
org.opentrafficsim.core.gtu.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,
org.opentrafficsim.core.gtu.RelativePosition relativePosition,
org.djunits.value.vdouble.scalar.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(org.opentrafficsim.core.gtu.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(org.opentrafficsim.core.gtu.RelativePosition relativePosition,
org.djunits.value.vdouble.scalar.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.
|
org.djunits.value.vdouble.scalar.Acceleration |
getCarFollowingAcceleration()
This method returns the current car-following acceleration of the GTU.
|
org.djunits.value.vdouble.scalar.Speed |
getDesiredSpeed()
This method returns the current desired speed of the GTU.
|
org.opentrafficsim.core.gtu.GTUDirectionality |
getDirection(Lane lane)
Return the directionality of a lane on which the GTU is registered for its current operational plan.
|
nl.tudelft.simulation.language.d3.DirectedPoint |
getLocation()
Return the location without a RemoteException.
|
DirectedLanePosition |
getReferencePosition()
Return the current Lane, position and directionality of the GTU.
|
LaneBasedStrategicalPlanner |
getStrategicalPlanner() |
LaneBasedStrategicalPlanner |
getStrategicalPlanner(org.djunits.value.vdouble.scalar.Time time) |
default LaneBasedTacticalPlanner |
getTacticalPlanner() |
default LaneBasedTacticalPlanner |
getTacticalPlanner(org.djunits.value.vdouble.scalar.Time time) |
org.opentrafficsim.core.gtu.TurnIndicatorStatus |
getTurnIndicatorStatus() |
org.opentrafficsim.core.gtu.TurnIndicatorStatus |
getTurnIndicatorStatus(org.djunits.value.vdouble.scalar.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(org.djunits.value.vdouble.scalar.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.
|
org.djunits.value.vdouble.scalar.Length |
position(Lane lane,
org.opentrafficsim.core.gtu.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.
|
org.djunits.value.vdouble.scalar.Length |
position(Lane lane,
org.opentrafficsim.core.gtu.RelativePosition relativePosition,
org.djunits.value.vdouble.scalar.Time when)
Return the longitudinal position of a point relative to this GTU, relative to the center line of the Lane.
|
Map<Lane,org.djunits.value.vdouble.scalar.Length> |
positions(org.opentrafficsim.core.gtu.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,org.djunits.value.vdouble.scalar.Length> |
positions(org.opentrafficsim.core.gtu.RelativePosition relativePosition,
org.djunits.value.vdouble.scalar.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.
|
org.djunits.value.vdouble.scalar.Length |
projectedPosition(Lane projectionLane,
org.opentrafficsim.core.gtu.RelativePosition relativePosition,
org.djunits.value.vdouble.scalar.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 |
setNoLaneChangeDistance(org.djunits.value.vdouble.scalar.Length distance)
Set distance over which the GTU should not change lane after being created.
|
void |
setTurnIndicatorStatus(org.opentrafficsim.core.gtu.TurnIndicatorStatus turnIndicatorStatus)
Set the status of the turn indicator.
|
org.djunits.value.vdouble.scalar.Length |
translatedPosition(Lane projectionLane,
org.opentrafficsim.core.gtu.RelativePosition relativePosition,
org.djunits.value.vdouble.scalar.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, getBaseColor, 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
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
LaneBasedStrategicalPlanner getStrategicalPlanner()
getStrategicalPlanner
in interface org.opentrafficsim.core.gtu.GTU
LaneBasedStrategicalPlanner getStrategicalPlanner(org.djunits.value.vdouble.scalar.Time time)
getStrategicalPlanner
in interface org.opentrafficsim.core.gtu.GTU
default LaneBasedTacticalPlanner getTacticalPlanner()
getTacticalPlanner
in interface org.opentrafficsim.core.gtu.GTU
default LaneBasedTacticalPlanner getTacticalPlanner(org.djunits.value.vdouble.scalar.Time time)
getTacticalPlanner
in interface org.opentrafficsim.core.gtu.GTU
nl.tudelft.simulation.language.d3.DirectedPoint getLocation()
getLocation
in interface nl.tudelft.simulation.dsol.animation.Locatable
void enterLane(Lane lane, org.djunits.value.vdouble.scalar.Length position, org.opentrafficsim.core.gtu.GTUDirectionality gtuDirection) throws org.opentrafficsim.core.gtu.GTUException
lane
- the lane to add to the list of lanes on which the GTU is registered.gtuDirection
- 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
- the position on the lane.org.opentrafficsim.core.gtu.GTUException
- when positioning the GTU on the lane causes a problemvoid leaveLane(Lane lane) throws org.opentrafficsim.core.gtu.GTUException
lane
- the lane to remove from the list of lanes on which the GTU is registered.org.opentrafficsim.core.gtu.GTUException
- when leaveLane should not be calledvoid changeLaneInstantaneously(org.opentrafficsim.core.network.LateralDirectionality laneChangeDirection) throws org.opentrafficsim.core.gtu.GTUException
laneChangeDirection
- the direction to change toorg.opentrafficsim.core.gtu.GTUException
- in case lane change failsMap<Lane,org.djunits.value.vdouble.scalar.Length> positions(org.opentrafficsim.core.gtu.RelativePosition relativePosition) throws org.opentrafficsim.core.gtu.GTUException
relativePosition
- the position on the vehicle relative to the reference point.org.opentrafficsim.core.gtu.GTUException
- when the vehicle is not on one of the lanes on which it is registered.Map<Lane,org.djunits.value.vdouble.scalar.Length> positions(org.opentrafficsim.core.gtu.RelativePosition relativePosition, org.djunits.value.vdouble.scalar.Time when) throws org.opentrafficsim.core.gtu.GTUException
relativePosition
- the position on the vehicle relative to the reference point.when
- the future time for which to calculate the positions.org.opentrafficsim.core.gtu.GTUException
- when the vehicle is not on one of the lanes on which it is registered.org.djunits.value.vdouble.scalar.Length position(Lane lane, org.opentrafficsim.core.gtu.RelativePosition relativePosition) throws org.opentrafficsim.core.gtu.GTUException
lane
- the position on this lane will be returned.relativePosition
- the position on the vehicle relative to the reference point.org.opentrafficsim.core.gtu.GTUException
- when the vehicle is not on the given lane.org.djunits.value.vdouble.scalar.Length position(Lane lane, org.opentrafficsim.core.gtu.RelativePosition relativePosition, org.djunits.value.vdouble.scalar.Time when) throws org.opentrafficsim.core.gtu.GTUException
lane
- the position on this lane will be returned.relativePosition
- the position on the vehicle relative to the reference point.when
- the future time for which to calculate the positions.org.opentrafficsim.core.gtu.GTUException
- when the vehicle is not on the given lane.Map<Lane,Double> fractionalPositions(org.opentrafficsim.core.gtu.RelativePosition relativePosition) throws org.opentrafficsim.core.gtu.GTUException
relativePosition
- the position on the vehicle relative to the reference point.org.opentrafficsim.core.gtu.GTUException
- when the vehicle is not on one of the lanes on which it is registered.Map<Lane,Double> fractionalPositions(org.opentrafficsim.core.gtu.RelativePosition relativePosition, org.djunits.value.vdouble.scalar.Time when) throws org.opentrafficsim.core.gtu.GTUException
relativePosition
- the position on the vehicle relative to the reference point.when
- the future time for which to calculate the positions.org.opentrafficsim.core.gtu.GTUException
- when the vehicle is not on one of the lanes on which it is registered.double fractionalPosition(Lane lane, org.opentrafficsim.core.gtu.RelativePosition relativePosition, org.djunits.value.vdouble.scalar.Time when) throws org.opentrafficsim.core.gtu.GTUException
lane
- the position on this lane will be returned.relativePosition
- the position on the vehicle relative to the reference point.when
- the future time for which to calculate the positions.org.opentrafficsim.core.gtu.GTUException
- when the vehicle is not on the given lane.double fractionalPosition(Lane lane, org.opentrafficsim.core.gtu.RelativePosition relativePosition) throws org.opentrafficsim.core.gtu.GTUException
lane
- the position on this lane will be returned.relativePosition
- the position on the vehicle relative to the reference point.org.opentrafficsim.core.gtu.GTUException
- when the vehicle is not on the given lane.org.djunits.value.vdouble.scalar.Length translatedPosition(Lane projectionLane, org.opentrafficsim.core.gtu.RelativePosition relativePosition, org.djunits.value.vdouble.scalar.Time when) throws org.opentrafficsim.core.gtu.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 GTUorg.opentrafficsim.core.gtu.GTUException
- when projectionLane it not in any of the CrossSectionLink that the GTU is onorg.djunits.value.vdouble.scalar.Length projectedPosition(Lane projectionLane, org.opentrafficsim.core.gtu.RelativePosition relativePosition, org.djunits.value.vdouble.scalar.Time when) throws org.opentrafficsim.core.gtu.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 GTUorg.opentrafficsim.core.gtu.GTUException
- when projectionLane it not in any of the CrossSectionLink that the GTU is onDirectedLanePosition getReferencePosition() throws org.opentrafficsim.core.gtu.GTUException
org.opentrafficsim.core.gtu.GTUException
- in case the reference position of the GTU cannot be found on the lanes in its current pathorg.opentrafficsim.core.gtu.GTUDirectionality getDirection(Lane lane) throws org.opentrafficsim.core.gtu.GTUException
lane
- Lane; the lane for which we want to know the directionorg.opentrafficsim.core.gtu.GTUException
- 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
- SimeEvent<SimTimeDoubleUnit> the eventvoid setNoLaneChangeDistance(org.djunits.value.vdouble.scalar.Length distance)
distance
- distance over which the GTU should not change lane after being createdboolean laneChangeAllowed()
org.djunits.value.vdouble.scalar.Speed getDesiredSpeed()
org.djunits.value.vdouble.scalar.Acceleration getCarFollowingAcceleration()
default VehicleModel getVehicleModel()
default boolean isBrakingLightsOn()
true
if the deceleration is larger than a speed-dependent threshold given
by:default boolean isBrakingLightsOn(org.djunits.value.vdouble.scalar.Time when)
true
if the deceleration is larger than a speed-dependent threshold given
by:when
- Time; timeorg.opentrafficsim.core.gtu.TurnIndicatorStatus getTurnIndicatorStatus()
org.opentrafficsim.core.gtu.TurnIndicatorStatus getTurnIndicatorStatus(org.djunits.value.vdouble.scalar.Time time)
time
- Time; time to obtain the turn indicator status atvoid setTurnIndicatorStatus(org.opentrafficsim.core.gtu.TurnIndicatorStatus turnIndicatorStatus) throws org.opentrafficsim.core.gtu.GTUException
turnIndicatorStatus
- the new status of the turn indicator.org.opentrafficsim.core.gtu.GTUException
- when GTUType does not have a turn indicatorCopyright © 2014–2018 Delft University of Technology. All rights reserved.