Record Class SpeedLimits
java.lang.Object
java.lang.Record
org.opentrafficsim.road.network.speed.SpeedLimits
- Record Components:
laneSpeedLimit- lane-level speed limit, may benullgtuTypeSpeedLimit- GTU type level speed limit, may benull
Speed limit for an instantaneous context of a single GTU. Two speed limits are included to capture nuances in adherence
behavior. For example, normally trucks may drive 80-90km/h based on a vehicle type speed limit of 80km/h on any road with a
speed limit higher than 80km/h. But on roads with lower speed limits adherence can be more strict. Although a truck driver
could drive 85km/h (5km/h faster than the GTU type limit) on a freeway with a speed limit of 100km/h, on a road with a speed
limit of 60km/h the truck driver may adhere to that fully. For a truck driver with low GTU type speed limit adherence (e.g.
95km/h), an enforced lane-level speed limit of 90km/h can be more constraining.
Copyright (c) 2026-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
- Author:
- Wouter Schakel
-
Constructor Summary
ConstructorsConstructorDescriptionSpeedLimits(SpeedLimit laneSpeedLimit, SpeedLimit gtuTypeSpeedLimit) Creates an instance of aSpeedLimitsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of thegtuTypeSpeedLimitrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of thelaneSpeedLimitrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SpeedLimits
Creates an instance of aSpeedLimitsrecord class.- Parameters:
laneSpeedLimit- the value for thelaneSpeedLimitrecord componentgtuTypeSpeedLimit- the value for thegtuTypeSpeedLimitrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
laneSpeedLimit
Returns the value of thelaneSpeedLimitrecord component.- Returns:
- the value of the
laneSpeedLimitrecord component
-
gtuTypeSpeedLimit
Returns the value of thegtuTypeSpeedLimitrecord component.- Returns:
- the value of the
gtuTypeSpeedLimitrecord component
-