Class SimpleOperationalPlan
- java.lang.Object
-
- org.opentrafficsim.road.gtu.lane.plan.operational.SimpleOperationalPlan
-
- All Implemented Interfaces:
Serializable
public class SimpleOperationalPlan extends Object implements Serializable
Simplified plan containing an acceleration value and possible lane change direction.Copyright (c) 2013-2020 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version Jul 26, 2016
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SimpleOperationalPlan(Acceleration acceleration, Duration duration)
SimpleOperationalPlan(Acceleration acceleration, Duration duration, LateralDirectionality laneChangeDirection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Acceleration
getAcceleration()
Duration
getDuration()
TurnIndicatorIntent
getIndicatorIntent()
LateralDirectionality
getLaneChangeDirection()
boolean
isLaneChange()
void
minimizeAcceleration(Acceleration a)
Set minimum of current and given acceleration.void
setAcceleration(Acceleration acceleration)
Sets acceleration.void
setIndicatorIntentLeft()
Set left indicator intent.void
setIndicatorIntentLeft(Length distance)
Set left indicator intent.void
setIndicatorIntentRight()
Set right indicator intent.void
setIndicatorIntentRight(Length distance)
Set right indicator intent.void
setTurnIndicator(LaneBasedGTU gtu)
String
toString()
-
-
-
Constructor Detail
-
SimpleOperationalPlan
public SimpleOperationalPlan(Acceleration acceleration, Duration duration)
- Parameters:
acceleration
- Acceleration; accelerationduration
- Duration; duration
-
SimpleOperationalPlan
public SimpleOperationalPlan(Acceleration acceleration, Duration duration, LateralDirectionality laneChangeDirection)
- Parameters:
acceleration
- Acceleration; accelerationduration
- Duration; durationlaneChangeDirection
- LateralDirectionality; lane change direction, may benull
.
-
-
Method Detail
-
getAcceleration
public final Acceleration getAcceleration()
- Returns:
- acceleration.
-
setAcceleration
public final void setAcceleration(Acceleration acceleration)
Sets acceleration.- Parameters:
acceleration
- Acceleration; acceleration
-
getDuration
public Duration getDuration()
- Returns:
- duration.
-
isLaneChange
public final boolean isLaneChange()
- Returns:
- if lane change.
-
getLaneChangeDirection
public final LateralDirectionality getLaneChangeDirection()
- Returns:
- laneChangeDirection, may be NONE if no lane change.
-
minimizeAcceleration
public final void minimizeAcceleration(Acceleration a)
Set minimum of current and given acceleration.- Parameters:
a
- Acceleration; acceleration to set if lower than current acceleration
-
getIndicatorIntent
public final TurnIndicatorIntent getIndicatorIntent()
- Returns:
- indicatorIntent.
-
setIndicatorIntentLeft
public final void setIndicatorIntentLeft()
Set left indicator intent. Any intent given with distance overrules this intent.
-
setIndicatorIntentRight
public final void setIndicatorIntentRight()
Set right indicator intent. Any intent given with distance overrules this intent.
-
setIndicatorIntentLeft
public final void setIndicatorIntentLeft(Length distance)
Set left indicator intent. Intent with smallest provided distance has priority.- Parameters:
distance
- Length; distance to object pertaining to the turn indicator intent
-
setIndicatorIntentRight
public final void setIndicatorIntentRight(Length distance)
Set right indicator intent. Intent with smallest provided distance has priority.- Parameters:
distance
- Length; distance to object pertaining to the turn indicator intent
-
setTurnIndicator
public final void setTurnIndicator(LaneBasedGTU gtu) throws GTUException
- Parameters:
gtu
- LaneBasedGTU; LaneBasedGTU to set the indicator on- Throws:
GTUException
- if GTU does not support the indicator
-
-