public class SpeedLimitProspect extends Object implements Serializable
Copyright (c) 2013-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Constructor and Description |
---|
SpeedLimitProspect() |
Modifier and Type | Method and Description |
---|---|
<T> void |
addSpeedInfo(org.djunits.value.vdouble.scalar.Length distance,
SpeedLimitType<T> speedLimitType,
T speedInfo)
Sets the speed info of a speed limit type.
|
<T> SpeedLimitInfo |
buildSpeedLimitInfo(org.djunits.value.vdouble.scalar.Length distance,
SpeedLimitType<T> speedLimitType)
Builds speed limit info with only MAX_VEHICLE_SPEED and the given speed limit type, where the speed info is obtained at
the given distance.
|
List<org.djunits.value.vdouble.scalar.Length> |
getDistances()
Returns the distances at which a change in the prospect is present in order (upstream first).
|
List<org.djunits.value.vdouble.scalar.Length> |
getDistances(SpeedLimitType<?> speedLimitType)
Returns the distances at which a change of the given speed limit type in the prospect is present in order (most upstream
first).
|
List<org.djunits.value.vdouble.scalar.Length> |
getDownstreamDistances(SpeedLimitType<?> speedLimitType)
Returns the downstream distances at which a change of the given speed limit type in the prospect is present in order
(most upstream first).
|
<T> T |
getSpeedInfoChange(org.djunits.value.vdouble.scalar.Length distance,
SpeedLimitType<T> speedLimitType)
Returns the speed info of given speed limit type where it changed.
|
SpeedLimitInfo |
getSpeedLimitInfo(org.djunits.value.vdouble.scalar.Length distance)
Returns the speed info at a given location.
|
SpeedLimitInfo |
getSpeedLimitInfo(org.djunits.value.vdouble.scalar.Speed speed,
org.djunits.value.vdouble.scalar.Acceleration acceleration,
org.djunits.value.vdouble.scalar.Duration time)
Returns the speed info at a location following an acceleration over some duration.
|
List<org.djunits.value.vdouble.scalar.Length> |
getUpstreamDistances(SpeedLimitType<?> speedLimitType)
Returns the upstream distances at which a change of the given speed limit type in the prospect is present in order (most
upstream first).
|
void |
removeSpeedInfo(org.djunits.value.vdouble.scalar.Length distance,
SpeedLimitType<?> speedLimitType)
Removes the speed info of a speed limit type.
|
boolean |
speedInfoChanged(org.djunits.value.vdouble.scalar.Length distance,
SpeedLimitType<?> speedLimitType)
Returns whether the given speed limit type is changed at the given distance.
|
String |
toString() |
public final <T> void addSpeedInfo(org.djunits.value.vdouble.scalar.Length distance, SpeedLimitType<T> speedLimitType, T speedInfo)
T
- class of speed infodistance
- location to set info for a speed limit typespeedLimitType
- speed limit type to set the info forspeedInfo
- speed info to setIllegalStateException
- if speed info for a specific speed limit type is set or removed twice at the same distanceIllegalStateException
- if speed info for a specific speed limit type is set twice with negative distanceNullPointerException
- if any input is nullpublic final void removeSpeedInfo(org.djunits.value.vdouble.scalar.Length distance, SpeedLimitType<?> speedLimitType)
distance
- distance to remove speed info of a speed limit typespeedLimitType
- speed limit type to remove speed info ofIllegalStateException
- if speed info for a specific speed limit type is set or removed twice at the same distanceIllegalArgumentException
- if the speed limit type is MAX_VEHICLE_SPEED
IllegalArgumentException
- if the distance is negativeNullPointerException
- if any input is nullpublic final List<org.djunits.value.vdouble.scalar.Length> getDistances()
public final List<org.djunits.value.vdouble.scalar.Length> getDistances(SpeedLimitType<?> speedLimitType)
speedLimitType
- speed limit type to get the distances ofpublic final List<org.djunits.value.vdouble.scalar.Length> getUpstreamDistances(SpeedLimitType<?> speedLimitType)
speedLimitType
- speed limit type to get the distances ofpublic final List<org.djunits.value.vdouble.scalar.Length> getDownstreamDistances(SpeedLimitType<?> speedLimitType)
speedLimitType
- speed limit type to get the distances ofpublic final boolean speedInfoChanged(org.djunits.value.vdouble.scalar.Length distance, SpeedLimitType<?> speedLimitType)
distance
- distance to checkspeedLimitType
- speed limit type to checkNullPointerException
- if distance is nullpublic final <T> T getSpeedInfoChange(org.djunits.value.vdouble.scalar.Length distance, SpeedLimitType<T> speedLimitType)
null
is returned.T
- class of the speed limit type infodistance
- distance where the info changedspeedLimitType
- speed limit typenull
if speed limit type is removedIllegalArgumentException
- if the speed info did not change at the given distance for the speed limit typepublic final SpeedLimitInfo getSpeedLimitInfo(org.djunits.value.vdouble.scalar.Length distance)
distance
- where to get the speed infoNullPointerException
- if distance is nullpublic final SpeedLimitInfo getSpeedLimitInfo(org.djunits.value.vdouble.scalar.Speed speed, org.djunits.value.vdouble.scalar.Acceleration acceleration, org.djunits.value.vdouble.scalar.Duration time)
speed
- current speedacceleration
- acceleration to applytime
- duration of accelerationNullPointerException
- if any input is nullpublic final <T> SpeedLimitInfo buildSpeedLimitInfo(org.djunits.value.vdouble.scalar.Length distance, SpeedLimitType<T> speedLimitType)
T
- class of speed info of given speed limit typedistance
- distance to get the speed info atspeedLimitType
- speed limit type of which to include the infoCopyright © 2014–2017 Delft University of Technology. All rights reserved.