ID
- The type of ID, e.g., String or Integerpublic interface LaneBasedGTU<ID> extends GTU<ID>
When calculating a headway, the GTU has to look in successive lanes. When Lanes (or underlying CrossSectionLinks) diverge, the headway algorithms have to look at multiple Lanes and return the minimum headway in each of the Lanes. When the Lanes (or underlying CrossSectionLinks) converge, "parallel" traffic is not taken into account in the headway calculation. Instead, gap acceptance algorithms or their equivalent should guide the merging behavior.
Copyright (c) 2013-2014 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Method and Description |
---|---|
void |
addFrontToSubsequentLane(Lane lane)
Register the lane with a GTU, at the start of the lane.
|
void |
addLane(Lane lane,
DoubleScalar.Rel<LengthUnit> position)
insert GTU at a certain position.
|
DoubleScalar.Rel<TimeUnit> |
deltaTimeForDistance(DoubleScalar.Rel<LengthUnit> distance)
Determine the time since last evaluation when this GTU has covered the specified distance from the position of the last
evaluation time.
|
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,
DoubleScalar.Abs<TimeUnit> 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,
DoubleScalar.Abs<TimeUnit> 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.
|
DoubleScalar.Abs<AccelerationUnit> |
getAcceleration() |
DoubleScalar.Abs<AccelerationUnit> |
getAcceleration(DoubleScalar.Abs<TimeUnit> when) |
GTUFollowingModel |
getGTUFollowingModel()
Retrieve the GTU following model of this LaneBasedGTU.
|
DoubleScalar.Abs<TimeUnit> |
getLastEvaluationTime() |
DoubleScalar.Abs<SpeedUnit> |
getLateralVelocity() |
DoubleScalar.Abs<SpeedUnit> |
getLongitudinalVelocity()
v(t) = v0 + (t - t0) * a.
|
DoubleScalar.Abs<SpeedUnit> |
getLongitudinalVelocity(DoubleScalar.Abs<TimeUnit> when)
Return the speed of this GTU at the specified time.
|
DoubleScalar.Abs<TimeUnit> |
getNextEvaluationTime() |
HeadwayGTU |
headway(DoubleScalar.Rel<LengthUnit> maxDistance)
Determine which GTU in front of this GTU, or behind this GTU.
|
HeadwayGTU |
headway(Lane lane,
DoubleScalar.Rel<LengthUnit> maxDistance)
Determine by what distance the front of this GTU is behind the rear an other GTU, or the rear of this GTU is ahead of the
front of an other GTU.
|
Set<LaneBasedGTU<?>> |
parallel(Lane lane,
DoubleScalar.Abs<TimeUnit> when)
Determine which GTUs are parallel with us on another lane, based on fractional positions.
|
Set<LaneBasedGTU<?>> |
parallel(LateralDirectionality lateralDirection,
DoubleScalar.Abs<TimeUnit> when)
Determine which GTUs are parallel with us in a certain lateral direction, based on fractional positions.
|
DoubleScalar.Rel<LengthUnit> |
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.
|
DoubleScalar.Rel<LengthUnit> |
position(Lane lane,
RelativePosition relativePosition,
DoubleScalar.Abs<TimeUnit> when)
Return the longitudinal position of a point relative to this GTU, relative to the center line of the Lane.
|
Map<Lane,DoubleScalar.Rel<LengthUnit>> |
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,DoubleScalar.Rel<LengthUnit>> |
positions(RelativePosition relativePosition,
DoubleScalar.Abs<TimeUnit> 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.
|
DoubleScalar.Rel<LengthUnit> |
projectedPosition(Lane projectionLane,
RelativePosition relativePosition,
DoubleScalar.Abs<TimeUnit> when)
Return the longitudinal position that this GTU would have if it were to change to another Lane with a/the current
CrossSectionLink.
|
void |
removeLane(Lane lane)
Unregister the GTU from a lane.
|
DoubleScalar.Abs<TimeUnit> |
timeAtDistance(DoubleScalar.Rel<LengthUnit> distance)
Determine the time when this GTU will have covered the specified distance from the position of the last evaluation time.
|
destroy, getFront, getGTUType, getId, getLength, getMaximumVelocity, getRear, getReference, getRelativePositions, getSimulator, getWidth
DoubleScalar.Abs<SpeedUnit> getLongitudinalVelocity() throws RemoteException
RemoteException
- in case of problems getting the simulation time.DoubleScalar.Abs<SpeedUnit> getLongitudinalVelocity(DoubleScalar.Abs<TimeUnit> when)
when
- time for which the speed must be returnedDoubleScalar.Abs<AccelerationUnit> getAcceleration() throws RemoteException
RemoteException
- in case of problems getting the simulation time.DoubleScalar.Abs<AccelerationUnit> getAcceleration(DoubleScalar.Abs<TimeUnit> when)
when
- time for which the speed must be returnedDoubleScalar.Abs<SpeedUnit> getLateralVelocity()
DoubleScalar.Abs<TimeUnit> getLastEvaluationTime()
DoubleScalar.Abs<TimeUnit> getNextEvaluationTime()
void addFrontToSubsequentLane(Lane lane) throws RemoteException, NetworkException
lane
- the lane to add to the list of lanes on which the GTU is registered.NetworkException
RemoteException
void addLane(Lane lane, DoubleScalar.Rel<LengthUnit> position) throws NetworkException
lane
- the lane to add to the list of lanes on which the GTU is registered.position
- the position on the lane.NetworkException
void removeLane(Lane lane)
lane
- the lane to remove from the list of lanes on which the GTU is registered.Map<Lane,DoubleScalar.Rel<LengthUnit>> positions(RelativePosition relativePosition) throws NetworkException, RemoteException
relativePosition
- the position on the vehicle relative to the reference point.RemoteException
- when simulator time cannot be retrieved.NetworkException
- when the vehicle is not on one of the lanes on which it is registered.Map<Lane,DoubleScalar.Rel<LengthUnit>> positions(RelativePosition relativePosition, DoubleScalar.Abs<TimeUnit> when) throws NetworkException
relativePosition
- the position on the vehicle relative to the reference point.when
- the future time for which to calculate the positions.NetworkException
- when the vehicle is not on one of the lanes on which it is registered.DoubleScalar.Rel<LengthUnit> position(Lane lane, RelativePosition relativePosition) throws NetworkException, RemoteException
lane
- the position on this lane will be returned.relativePosition
- the position on the vehicle relative to the reference point.NetworkException
- when the vehicle is not on the given lane.RemoteException
- when simulator time cannot be retrieved.DoubleScalar.Rel<LengthUnit> position(Lane lane, RelativePosition relativePosition, DoubleScalar.Abs<TimeUnit> when) throws NetworkException
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.NetworkException
- when the vehicle is not on the given lane.Map<Lane,Double> fractionalPositions(RelativePosition relativePosition) throws NetworkException, RemoteException
relativePosition
- the position on the vehicle relative to the reference point.RemoteException
- when simulator time cannot be retrieved.NetworkException
- when the vehicle is not on one of the lanes on which it is registered.Map<Lane,Double> fractionalPositions(RelativePosition relativePosition, DoubleScalar.Abs<TimeUnit> when) throws NetworkException
relativePosition
- the position on the vehicle relative to the reference point.when
- the future time for which to calculate the positions.NetworkException
- when the vehicle is not on one of the lanes on which it is registered.double fractionalPosition(Lane lane, RelativePosition relativePosition, DoubleScalar.Abs<TimeUnit> when) throws NetworkException
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.NetworkException
- when the vehicle is not on the given lane.double fractionalPosition(Lane lane, RelativePosition relativePosition) throws NetworkException, RemoteException
lane
- the position on this lane will be returned.relativePosition
- the position on the vehicle relative to the reference point.NetworkException
- when the vehicle is not on the given lane.RemoteException
- when simulator time cannot be retrieved.DoubleScalar.Rel<LengthUnit> projectedPosition(Lane projectionLane, RelativePosition relativePosition, DoubleScalar.Abs<TimeUnit> when) throws NetworkException
projectionLane
- Lane; the lane onto which the position of this GTU must be projectedrelativePosition
- RelativePosition; the point on this GTU that must be projectedwhen
- DoubleScalar.Abs<TimeUnit>; the time for which to project the position of this GTUNetworkException
- when projectionLane it not in any of the CrossSectionLink that the GTU is onHeadwayGTU headway(DoubleScalar.Rel<LengthUnit> maxDistance) throws RemoteException, NetworkException
maxDistance
- the maximum distance to look for the nearest GTU; positive values search forwards; negative values
search backwardsRemoteException
- when simulator time cannot be retrieved.NetworkException
- when there is an error with the next lanes in the network.HeadwayGTU headway(Lane lane, DoubleScalar.Rel<LengthUnit> maxDistance) throws RemoteException, NetworkException
new DoubleScalar.Rel(Double.MAX_VALUE, LengthUnit.METER)
is returned. The search will extend
into successive lanes if the maxDistance is larger than the length of the lane.lane
- the lane to look for another GTUmaxDistance
- the maximum distance to look for; if positive, the search is forwards; if negative, the search is
backwardsRemoteException
- when simulator time cannot be retrievedNetworkException
- when the vehicle's route is inconclusive or vehicles are not registered correctly on their lanesSet<LaneBasedGTU<?>> parallel(Lane lane, DoubleScalar.Abs<TimeUnit> when) throws RemoteException, NetworkException
lane
- the lane to look for parallel (partial or full overlapping) GTUs.when
- the future time for which to calculate the headwayRemoteException
- when simulator time cannot be retrieved.NetworkException
- when the vehicle's route is inconclusive, when vehicles are not registered correctly on their
lanes, or when the given lane is not parallel to one of the lanes where we are registered.Set<LaneBasedGTU<?>> parallel(LateralDirectionality lateralDirection, DoubleScalar.Abs<TimeUnit> when) throws RemoteException, NetworkException
lateralDirection
- the direction of the adjacent lane(s) to look for parallel (partial or full overlapping) GTUs.when
- the future time for which to calculate the headwayRemoteException
- when simulator time cannot be retrieved.NetworkException
- when the vehicle's route is inconclusive, when vehicles are not registered correctly on their
lanes, or when there are no lanes parallel to one of the lanes where we are registered in the given
direction.DoubleScalar.Abs<TimeUnit> timeAtDistance(DoubleScalar.Rel<LengthUnit> distance)
distance
- DoubleScalar.Rel<LengthUnit>; the distanceDoubleScalar.Rel<TimeUnit> deltaTimeForDistance(DoubleScalar.Rel<LengthUnit> distance)
distance
- DoubleScalar.Rel<LengthUnit>; the distanceGTUFollowingModel getGTUFollowingModel()
Copyright © 2014–2015 Delft University of Technology. All rights reserved.