Class LaneBasedOperationalPlan
- java.lang.Object
-
- org.opentrafficsim.core.gtu.plan.operational.OperationalPlan
-
- org.opentrafficsim.road.gtu.lane.plan.operational.LaneBasedOperationalPlan
-
- All Implemented Interfaces:
Serializable
public class LaneBasedOperationalPlan extends OperationalPlan
An operational plan with some extra information about the lanes and lane changes so this information does not have to be recalculated multiple times. Furthermore, it is quite expensive to check whether a lane change is part of the oprtational plan based on geographical data.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Jan 20, 2016
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.opentrafficsim.core.gtu.plan.operational.OperationalPlan
OperationalPlan.AccelerationSegment, OperationalPlan.Segment, OperationalPlan.SpeedSegment
-
-
Field Summary
-
Fields inherited from class org.opentrafficsim.core.gtu.plan.operational.OperationalPlan
DRIFTING_SPEED_SI
-
-
Constructor Summary
Constructors Constructor Description LaneBasedOperationalPlan(LaneBasedGTU gtu, DirectedPoint waitPoint, Time startTime, Duration duration, boolean deviative)
Build a plan where the GTU will wait for a certain time.LaneBasedOperationalPlan(LaneBasedGTU gtu, OTSLine3D path, Time startTime, Speed startSpeed, List<OperationalPlan.Segment> operationalPlanSegmentList, boolean deviative)
Construct an operational plan with or without a lane change.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Length
getDistanceAlongLane(LaneBasedGTU gtu, DirectedPoint point)
Returns the distance along the reference lane that the GTU travels from the current location up to the point.Length
getTotalLengthAlongLane(LaneBasedGTU gtu)
Returns the total length along the reference lane that the GTU travels.boolean
isDeviative()
Check if we deviate from the center line.String
toString()
-
Methods inherited from class org.opentrafficsim.core.gtu.plan.operational.OperationalPlan
equals, getAcceleration, getAcceleration, getEndLocation, getEndSpeed, getEndTime, getLocation, getLocation, getLocation, getOperationalPlanSegmentList, getPath, getSpeed, getSpeed, getStartSpeed, getStartTime, getTotalDuration, getTotalLength, getTraveledDistance, getTraveledDistance, getTraveledDistanceSI, getTraveledDistanceSI, hashCode, timeAtDistance, timeAtPoint
-
-
-
-
Constructor Detail
-
LaneBasedOperationalPlan
public LaneBasedOperationalPlan(LaneBasedGTU gtu, OTSLine3D path, Time startTime, Speed startSpeed, List<OperationalPlan.Segment> operationalPlanSegmentList, boolean deviative) throws OperationalPlanException
Construct an operational plan with or without a lane change.- Parameters:
gtu
- LaneBasedGTU; the GTU for debugging purposespath
- OTSLine3D; the path to follow from a certain time till a certain time. The path should have <i>at least</i> the lengthstartTime
- Time; the absolute start time when we start executing the pathstartSpeed
- Speed; the GTU speed when we start executing the pathoperationalPlanSegmentList
- List<Segment>; the segments that make up the path with an acceleration, constant speed or deceleration profiledeviative
- boolean; whether the path is not along lane center lines- Throws:
OperationalPlanException
- when the path is too short for the operation
-
LaneBasedOperationalPlan
public LaneBasedOperationalPlan(LaneBasedGTU gtu, DirectedPoint waitPoint, Time startTime, Duration duration, boolean deviative) throws OperationalPlanException
Build a plan where the GTU will wait for a certain time. Of course no lane change takes place.- Parameters:
gtu
- LaneBasedGTU; the GTU for debugging purposeswaitPoint
- DirectedPoint; the point at which the GTU will waitstartTime
- Time; the current time or a time in the future when the plan should startduration
- Duration; the waiting timedeviative
- boolean; whether the path is not along lane center lines- Throws:
OperationalPlanException
- when construction of a waiting path fails
-
-
Method Detail
-
isDeviative
public final boolean isDeviative()
Check if we deviate from the center line.- Returns:
- whether this maneuver involves deviation from the center line.
-
getTotalLengthAlongLane
public final Length getTotalLengthAlongLane(LaneBasedGTU gtu) throws GTUException
Returns the total length along the reference lane that the GTU travels. In case of a deviative plan this involves projection of the actual path to the lane center lines.- Parameters:
gtu
- LaneBasedGTU; GTU- Returns:
- Length; total length along the path
- Throws:
GTUException
- if the GTU has not reference position
-
getDistanceAlongLane
public final Length getDistanceAlongLane(LaneBasedGTU gtu, DirectedPoint point) throws GTUException
Returns the distance along the reference lane that the GTU travels from the current location up to the point.- Parameters:
gtu
- LaneBasedGTU; GTUpoint
- DirectedPoint; point where the GTU is or will be- Returns:
- Length; total length along the path
- Throws:
GTUException
- if the GTU has not reference position
-
toString
public final String toString()
- Overrides:
toString
in classOperationalPlan
-
-