public class LaneBlock extends AbstractGTU<Integer> implements LaneBasedGTU<Integer>
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 | Field and Description |
|---|---|
static GTUType<String> |
BLOCK_GTU
blocking GTU type.
|
odometer| Constructor and Description |
|---|
LaneBlock(Lane lane,
DoubleScalar.Rel<LengthUnit> position,
OTSDEVSSimulatorInterface simulator,
Class<? extends Renderable2D> animationClass) |
| 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.
|
void |
destroy()
destroy the vehicle from the simulation and animation.
|
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) |
javax.media.j3d.Bounds |
getBounds() |
RelativePosition |
getFront() |
GTUFollowingModel |
getGTUFollowingModel()
Retrieve the GTU following model of this LaneBasedGTU.
|
LaneChangeUrgeGTUColorer.LaneChangeDistanceAndDirection |
getLaneChangeDistanceAndDirection()
Return the distance available for the next needed lane change and the lateral direction of that lane change.
|
DoubleScalar.Abs<TimeUnit> |
getLastEvaluationTime() |
DoubleScalar.Abs<SpeedUnit> |
getLateralVelocity() |
DoubleScalar.Rel<LengthUnit> |
getLength() |
DirectedPoint |
getLocation() |
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<SpeedUnit> |
getMaximumVelocity() |
DoubleScalar.Abs<TimeUnit> |
getNextEvaluationTime() |
DoubleScalar.Abs<LengthUnit> |
getOdometer()
Retrieve the odometer value.
|
RelativePosition |
getRear() |
Map<RelativePosition.TYPE,RelativePosition> |
getRelativePositions() |
OTSDEVSSimulatorInterface |
getSimulator() |
DoubleScalar.Abs<SpeedUnit> |
getVelocity() |
DoubleScalar.Rel<LengthUnit> |
getWidth() |
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.
|
getGTUType, getId, getReference, getRoute, setRouteclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetGTUType, getId, getReferencepublic LaneBlock(Lane lane, DoubleScalar.Rel<LengthUnit> position, OTSDEVSSimulatorInterface simulator, Class<? extends Renderable2D> animationClass) throws GTUException, RemoteException, NetworkException, NamingException
lane - The lane where the block has to be putposition - the position on the lane as a lengthsimulator - the simulator to avoid NullPointerExceptionsanimationClass - Class<? extends Renderable2D>; the class for animation or null if no animationGTUException - when GTU cannot be created.NamingException - if an error occurs when adding the animation handlerRemoteException - when the simulator cannot be reachedNetworkException - when the GTU cannot be placed on the given lanepublic final DoubleScalar.Rel<LengthUnit> getLength()
public final DoubleScalar.Rel<LengthUnit> getWidth()
public final DoubleScalar.Abs<SpeedUnit> getMaximumVelocity()
getMaximumVelocity in interface GTU<Integer>public final OTSDEVSSimulatorInterface getSimulator()
getSimulator in interface GTU<Integer>public final RelativePosition getFront()
public final RelativePosition getRear()
public final DoubleScalar.Abs<SpeedUnit> getVelocity() throws RemoteException
getVelocity in interface GTU<Integer>RemoteException - on communications failurepublic final Map<RelativePosition.TYPE,RelativePosition> getRelativePositions()
getRelativePositions in interface GTU<Integer>public final void destroy()
public final DoubleScalar.Abs<AccelerationUnit> getAcceleration() throws RemoteException
getAcceleration in interface GTU<Integer>getAcceleration in interface LaneBasedGTU<Integer>RemoteException - in case of problems getting the simulation time.public final DirectedPoint getLocation() throws RemoteException
getLocation in interface LocatableInterfaceRemoteExceptionpublic final javax.media.j3d.Bounds getBounds()
throws RemoteException
getBounds in interface LocatableInterfaceRemoteExceptionpublic final DoubleScalar.Abs<LengthUnit> getOdometer() throws RemoteException
getOdometer in class AbstractGTU<Integer>RemoteException - on communications failurepublic final DoubleScalar.Abs<SpeedUnit> getLongitudinalVelocity() throws RemoteException
getLongitudinalVelocity in interface LaneBasedGTU<Integer>RemoteException - in case of problems getting the simulation time.public final DoubleScalar.Abs<SpeedUnit> getLongitudinalVelocity(DoubleScalar.Abs<TimeUnit> when)
getLongitudinalVelocity in interface LaneBasedGTU<Integer>when - time for which the speed must be returnedpublic final DoubleScalar.Abs<AccelerationUnit> getAcceleration(DoubleScalar.Abs<TimeUnit> when)
getAcceleration in interface LaneBasedGTU<Integer>when - time for which the speed must be returnedpublic final DoubleScalar.Abs<SpeedUnit> getLateralVelocity()
getLateralVelocity in interface LaneBasedGTU<Integer>public final DoubleScalar.Abs<TimeUnit> getLastEvaluationTime()
getLastEvaluationTime in interface LaneBasedGTU<Integer>public final DoubleScalar.Abs<TimeUnit> getNextEvaluationTime()
getNextEvaluationTime in interface LaneBasedGTU<Integer>public final void addFrontToSubsequentLane(Lane lane) throws RemoteException, NetworkException
addFrontToSubsequentLane in interface LaneBasedGTU<Integer>lane - the lane to add to the list of lanes on which the GTU is registered.RemoteException - on communications failureNetworkException - on network inconsistencypublic final void addLane(Lane lane, DoubleScalar.Rel<LengthUnit> position) throws NetworkException
addLane in interface LaneBasedGTU<Integer>lane - the lane to add to the list of lanes on which the GTU is registered.position - the position on the lane.NetworkException - on network inconsistencypublic final void removeLane(Lane lane)
removeLane in interface LaneBasedGTU<Integer>lane - the lane to remove from the list of lanes on which the GTU is registered.public final Map<Lane,DoubleScalar.Rel<LengthUnit>> positions(RelativePosition relativePosition) throws NetworkException, RemoteException
positions in interface LaneBasedGTU<Integer>relativePosition - the position on the vehicle relative to the reference point.NetworkException - when the vehicle is not on one of the lanes on which it is registered.RemoteException - when simulator time cannot be retrieved.public final Map<Lane,DoubleScalar.Rel<LengthUnit>> positions(RelativePosition relativePosition, DoubleScalar.Abs<TimeUnit> when) throws NetworkException, RemoteException
positions in interface LaneBasedGTU<Integer>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.RemoteException - on communications failurepublic final DoubleScalar.Rel<LengthUnit> position(Lane lane, RelativePosition relativePosition) throws NetworkException, RemoteException
position in interface LaneBasedGTU<Integer>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.public final DoubleScalar.Rel<LengthUnit> position(Lane lane, RelativePosition relativePosition, DoubleScalar.Abs<TimeUnit> when) throws NetworkException, RemoteException
position in interface LaneBasedGTU<Integer>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.RemoteException - on communications failurepublic final Map<Lane,Double> fractionalPositions(RelativePosition relativePosition) throws NetworkException, RemoteException
fractionalPositions in interface LaneBasedGTU<Integer>relativePosition - the position on the vehicle relative to the reference point.NetworkException - when the vehicle is not on one of the lanes on which it is registered.RemoteException - when simulator time cannot be retrieved.public Map<Lane,Double> fractionalPositions(RelativePosition relativePosition, DoubleScalar.Abs<TimeUnit> when) throws NetworkException, RemoteException
fractionalPositions in interface LaneBasedGTU<Integer>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.RemoteException - on communications failurepublic double fractionalPosition(Lane lane, RelativePosition relativePosition, DoubleScalar.Abs<TimeUnit> when) throws NetworkException, RemoteException
fractionalPosition in interface LaneBasedGTU<Integer>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.RemoteException - on communications failurepublic double fractionalPosition(Lane lane, RelativePosition relativePosition) throws NetworkException, RemoteException
fractionalPosition in interface LaneBasedGTU<Integer>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.public DoubleScalar.Rel<LengthUnit> projectedPosition(Lane projectionLane, RelativePosition relativePosition, DoubleScalar.Abs<TimeUnit> when) throws NetworkException, RemoteException
projectedPosition in interface LaneBasedGTU<Integer>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 onRemoteException - on communications failurepublic HeadwayGTU headway(DoubleScalar.Rel<LengthUnit> maxDistance) throws RemoteException, NetworkException
headway in interface LaneBasedGTU<Integer>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.public HeadwayGTU headway(Lane lane, DoubleScalar.Rel<LengthUnit> maxDistance) throws RemoteException, NetworkException
new DoubleScalar.Rel<LengthUnit>(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.headway in interface LaneBasedGTU<Integer>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 lanespublic Set<LaneBasedGTU<?>> parallel(Lane lane, DoubleScalar.Abs<TimeUnit> when) throws RemoteException, NetworkException
parallel in interface LaneBasedGTU<Integer>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.public Set<LaneBasedGTU<?>> parallel(LateralDirectionality lateralDirection, DoubleScalar.Abs<TimeUnit> when) throws RemoteException, NetworkException
parallel in interface LaneBasedGTU<Integer>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.public DoubleScalar.Abs<TimeUnit> timeAtDistance(DoubleScalar.Rel<LengthUnit> distance)
timeAtDistance in interface LaneBasedGTU<Integer>distance - DoubleScalar.Rel<LengthUnit>; the distancepublic DoubleScalar.Rel<TimeUnit> deltaTimeForDistance(DoubleScalar.Rel<LengthUnit> distance)
deltaTimeForDistance in interface LaneBasedGTU<Integer>distance - DoubleScalar.Rel<LengthUnit>; the distancepublic GTUFollowingModel getGTUFollowingModel()
getGTUFollowingModel in interface LaneBasedGTU<Integer>public LaneChangeUrgeGTUColorer.LaneChangeDistanceAndDirection getLaneChangeDistanceAndDirection()
getLaneChangeDistanceAndDirection in interface LaneBasedGTU<Integer>Copyright © 2014–2015 Delft University of Technology. All rights reserved.