Class OperationalPlan.SpeedSegment
- java.lang.Object
-
- org.opentrafficsim.core.gtu.plan.operational.OperationalPlan.Segment
-
- org.opentrafficsim.core.gtu.plan.operational.OperationalPlan.SpeedSegment
-
- All Implemented Interfaces:
Serializable
- Enclosing class:
- OperationalPlan
public static class OperationalPlan.SpeedSegment extends OperationalPlan.Segment
The segment of an operational plan in which the speed is constant.Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands.
$LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $, initial version Nov 14, 2015
All rights reserved.
BSD-style license. See OpenTrafficSim License.- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.opentrafficsim.core.gtu.plan.operational.OperationalPlan.Segment
duration, v0
-
-
Constructor Summary
Constructors Constructor Description SpeedSegment(Duration duration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) double
accelerationSI(double t)
Calculate the acceleration of a GTU in this segment after relative time t.(package private) double
distanceSI(double t)
Calculate the distance covered by a GTU in this segment after relative time t.(package private) Speed
endSpeed()
Calculate the end speed for this segment.Speed
getSpeed()
(package private) double
speedSI(double t)
Calculate the speed of a GTU in this segment after relative time t.Duration
timeAtDistance(Length distance)
Calculate the time it takes for the GTU to travel from the start of this Segment to the specified distance within this Segment.String
toString()
-
Methods inherited from class org.opentrafficsim.core.gtu.plan.operational.OperationalPlan.Segment
distanceSI, equals, getDuration, getDurationSI, hashCode, setV0
-
-
-
-
Constructor Detail
-
SpeedSegment
public SpeedSegment(Duration duration)
- Parameters:
duration
- Duration; the duration of the constant speed for this segment
-
-
Method Detail
-
distanceSI
final double distanceSI(double t)
Calculate the distance covered by a GTU in this segment after relative time t.- Specified by:
distanceSI
in classOperationalPlan.Segment
- Parameters:
t
- double; the relative time since starting this segment for which to calculate the distance covered- Returns:
- distance covered
-
accelerationSI
final double accelerationSI(double t)
Calculate the acceleration of a GTU in this segment after relative time t.- Specified by:
accelerationSI
in classOperationalPlan.Segment
- Parameters:
t
- double; the relative time since starting this segment for which to calculate the acceleration- Returns:
- acceleration at relative time t
-
speedSI
final double speedSI(double t)
Calculate the speed of a GTU in this segment after relative time t.- Specified by:
speedSI
in classOperationalPlan.Segment
- Parameters:
t
- double; the relative time since starting this segment for which to calculate the speed- Returns:
- speed at relative time t
-
endSpeed
final Speed endSpeed()
Calculate the end speed for this segment.- Specified by:
endSpeed
in classOperationalPlan.Segment
- Returns:
- speed at end of the segment
-
getSpeed
public final Speed getSpeed()
- Returns:
- speed
-
timeAtDistance
public final Duration timeAtDistance(Length distance)
Calculate the time it takes for the GTU to travel from the start of this Segment to the specified distance within this Segment.- Specified by:
timeAtDistance
in classOperationalPlan.Segment
- Parameters:
distance
- Length; the distance for which the travel time has to be calculated- Returns:
- the time at distance
-
-