public final class LaneOperationalPlanBuilder extends Object
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 boolean |
INSTANT_LANE_CHANGES
Use instant lane changes.
|
Modifier and Type | Method and Description |
---|---|
static Duration |
brakingTime(Acceleration acceleration,
Speed startSpeed,
Duration time)
Returns the effective braking time, which stops if stand-still is reached.
|
static LaneBasedOperationalPlan |
buildAccelerationLaneChangePlan(LaneBasedGTU gtu,
LateralDirectionality laneChangeDirectionality,
DirectedPoint startPosition,
Time startTime,
Speed startSpeed,
Acceleration acceleration,
Duration timeStep,
LaneChange laneChange)
Build a plan with a path and a given start speed to try to reach a provided end speed.
|
static LaneBasedOperationalPlan |
buildAccelerationPlan(LaneBasedGTU gtu,
Time startTime,
Speed startSpeed,
Acceleration acceleration,
Duration timeStep)
Build a plan with a path and a given start speed to try to reach a provided end speed.
|
static LaneBasedOperationalPlan |
buildGradualAccelerationPlan(LaneBasedGTU gtu,
Length distance,
Time startTime,
Speed startSpeed,
Speed endSpeed)
Build a plan with a path and a given start speed to reach a provided end speed, exactly at the end of the curve.
|
static LaneBasedOperationalPlan |
buildGradualAccelerationPlan(LaneBasedGTU gtu,
Length distance,
Time startTime,
Speed startSpeed,
Speed endSpeed,
Acceleration maxAcceleration,
Acceleration maxDeceleration)
Build a plan with a path and a given start speed to try to reach a provided end speed, exactly at the end of the curve.
|
static LaneBasedOperationalPlan |
buildMaximumAccelerationPlan(LaneBasedGTU gtu,
Length distance,
Time startTime,
Speed startSpeed,
Speed endSpeed,
Acceleration acceleration,
Acceleration deceleration)
Build a plan with a path and a given start speed to try to reach a provided end speed.
|
static LaneBasedOperationalPlan |
buildPlanFromSimplePlan(LaneBasedGTU gtu,
Time startTime,
SimpleOperationalPlan simplePlan,
LaneChange laneChange)
Build an operational plan based on a simple operational plan and status info.
|
static LaneBasedOperationalPlan |
buildStopPlan(LaneBasedGTU gtu,
Length distance,
Time startTime,
Speed startSpeed,
Acceleration deceleration)
Build a plan with a path and a given start speed to try to come to a stop with a given deceleration.
|
static OTSLine3D |
createPathAlongCenterLine(LaneBasedGTU gtu,
Length distance)
Creates a path along lane center lines.
|
static void |
scheduleLaneChangeFinalization(LaneBasedGTU gtu,
Length distance,
LateralDirectionality laneChangeDirection)
Schedules a lane change finalization after the given distance is covered.
|
public static boolean INSTANT_LANE_CHANGES
public static LaneBasedOperationalPlan buildGradualAccelerationPlan(LaneBasedGTU gtu, Length distance, Time startTime, Speed startSpeed, Speed endSpeed, Acceleration maxAcceleration, Acceleration maxDeceleration) throws OperationalPlanException, OTSGeometryException
gtu
- the GTU for debugging purposesdistance
- distance to drive for reaching the end speedstartTime
- the current time or a time in the future when the plan should startstartSpeed
- the speed at the start of the pathendSpeed
- the required end speedmaxAcceleration
- the maximum acceleration that can be applied, provided as a POSITIVE numbermaxDeceleration
- the maximum deceleration that can be applied, provided as a NEGATIVE numberOperationalPlanException
- when the plan cannot be generated, e.g. because of a path that is too shortOperationalPlanException
- when the length of the path and the calculated driven distance implied by the
constructed segment list differ more than a given thresholdOTSGeometryException
- in case the lanes are not connected or firstLanePosition is larger than the length of the
first lanepublic static LaneBasedOperationalPlan buildGradualAccelerationPlan(LaneBasedGTU gtu, Length distance, Time startTime, Speed startSpeed, Speed endSpeed) throws OperationalPlanException, OTSGeometryException
gtu
- the GTU for debugging purposesdistance
- distance to drive for reaching the end speedstartTime
- the current time or a time in the future when the plan should startstartSpeed
- the speed at the start of the pathendSpeed
- the required end speedOperationalPlanException
- when the length of the path and the calculated driven distance implied by the
constructed segment list differ more than a given thresholdOTSGeometryException
- in case the lanes are not connected or firstLanePositiion is larger than the length of the
first lanepublic static LaneBasedOperationalPlan buildMaximumAccelerationPlan(LaneBasedGTU gtu, Length distance, Time startTime, Speed startSpeed, Speed endSpeed, Acceleration acceleration, Acceleration deceleration) throws OperationalPlanException, OTSGeometryException
gtu
- the GTU for debugging purposesdistance
- distance to drive for reaching the end speedstartTime
- the current time or a time in the future when the plan should startstartSpeed
- the speed at the start of the pathendSpeed
- the required end speedacceleration
- the acceleration to use if endSpeed > startSpeed, provided as a POSITIVE numberdeceleration
- the deceleration to use if endSpeed < startSpeed, provided as a NEGATIVE numberOperationalPlanException
- when the construction of the operational path failsOTSGeometryException
- in case the lanes are not connected or firstLanePositiion is larger than the length of the
first lanepublic static LaneBasedOperationalPlan buildAccelerationPlan(LaneBasedGTU gtu, Time startTime, Speed startSpeed, Acceleration acceleration, Duration timeStep) throws OperationalPlanException, OTSGeometryException
gtu
- the GTU for debugging purposesstartTime
- the current time or a time in the future when the plan should startstartSpeed
- the speed at the start of the pathacceleration
- the acceleration to usetimeStep
- time step for the planOperationalPlanException
- when the construction of the operational path failsOTSGeometryException
- in case the lanes are not connected or firstLanePositiion is larger than the length of the
first lanepublic static OTSLine3D createPathAlongCenterLine(LaneBasedGTU gtu, Length distance) throws OTSGeometryException
gtu
- LaneBasedGTU; gtudistance
- Length; minimum distanceOTSGeometryException
- when any of the OTSLine3D operations failspublic static LaneBasedOperationalPlan buildAccelerationLaneChangePlan(LaneBasedGTU gtu, LateralDirectionality laneChangeDirectionality, DirectedPoint startPosition, Time startTime, Speed startSpeed, Acceleration acceleration, Duration timeStep, LaneChange laneChange) throws OperationalPlanException, OTSGeometryException
gtu
- the GTU for debugging purposeslaneChangeDirectionality
- direction of lane change (on initiation only, after that not important)startPosition
- current positionstartTime
- the current time or a time in the future when the plan should startstartSpeed
- the speed at the start of the pathacceleration
- the acceleration to usetimeStep
- time step for the planlaneChange
- lane change statusOperationalPlanException
- when the construction of the operational path failsOTSGeometryException
- in case the lanes are not connected or firstLanePositiion is larger than the length of the
first lanepublic static Duration brakingTime(Acceleration acceleration, Speed startSpeed, Duration time)
acceleration
- Acceleration; accelerationstartSpeed
- Speed; start speedtime
- Duration; intended time steppublic static LaneBasedOperationalPlan buildPlanFromSimplePlan(LaneBasedGTU gtu, Time startTime, SimpleOperationalPlan simplePlan, LaneChange laneChange) throws ParameterException, GTUException, NetworkException, OperationalPlanException
gtu
- gtustartTime
- start time for plansimplePlan
- simple operational planlaneChange
- lane change statusParameterException
- if parameter is not definedGTUException
- gtu exceptionNetworkException
- network exceptionOperationalPlanException
- operational plan exeptionpublic static void scheduleLaneChangeFinalization(LaneBasedGTU gtu, Length distance, LateralDirectionality laneChangeDirection) throws SimRuntimeException
gtu
- LaneBasedGTU; gtudistance
- Length; distancelaneChangeDirection
- LateralDirectionality; lane change directionSimRuntimeException
- on bad timepublic static LaneBasedOperationalPlan buildStopPlan(LaneBasedGTU gtu, Length distance, Time startTime, Speed startSpeed, Acceleration deceleration) throws OperationalPlanException, OTSGeometryException
gtu
- the GTU for debugging purposesdistance
- distance to drive for reaching the end speedstartTime
- the current time or a time in the future when the plan should startstartSpeed
- the speed at the start of the pathdeceleration
- the deceleration to use if endSpeed < startSpeed, provided as a NEGATIVE numberOperationalPlanException
- when construction of the operational path failsOTSGeometryException
- in case the lanes are not connected or firstLanePositiion is larger than the length of the
first laneCopyright © 2014–2018 Delft University of Technology. All rights reserved.