In certain situations, the speed limit can differ according to vehicle type; for instance, on a single-carriageway road in the UK, vehicles over 7.5 tonnes can only travel at 50 miles per hour but other vehicles can travel at 60 miles per hour. You can code this within the delay functions for macroscopic models or through the use of traffic management for microscopic and mesoscopic models as explained in part 1.
For macroscopic models, a vehicle’s travel time (and thus speed) is specified by the volume delay function, turn penalty function and junction delay function. These functions can read parameters such as speed limit to estimate a travel time along a section or turn. To alter the speed by vehicle type, you must therefore make edits within these functions.
For this pro tip, we will code the UK rules on single carriageway roads for a volume delay function. A similar approach would be taken on the turn penalty functions. We will need to check the road type, vehicle type and number of lanes.
To find out the vehicle type being considered, use: