Make great videos with the Aimsun recorder
April 2017: Laura Torres, Sergi Pujadas and Emmanuel Bert explain the nuts and bolts of how to get your Aimsun videos looking sharp and running smoothly.
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:
vehicle = context.userClass.getVehicle()
To find out the speed limit being considered, use:
SectionSpeed=section.getSpeed()
To find out the number of lanes being considered, use:
NbLanes=section.getNbFullLanes()
The speed along a section can then be specified using the following function:
def freeFlowTravelTime(context, section, funcVolume):
model = context.experiment.getModel()
vehicleName = context.userClass.getVehicle().getName()
SectionSpeed=section.getSpeed()
NbLanes=section.getNbFullLanes()
if vehicleName==”HGV” and SectionSpeed==96 and NbLanes==1: #If its a HGV on a single carriageway road with a 96kph/60mph limit
speed=80
else:
speed=SectionSpeed
distance=section.length3D() / 1000.0 # Km
t0 = distance/speed # hour
return t0
This could be expanded with other vehicle types such as trailered vehicles if necessary.
This freeflowspeed function should then be integrated into the VDF. For example using the BPR function. It is important however to still take into account the delay within the total travel time. We will therefore calculate travel time as the maximum of the volume specific travel time and the vehicle speed limit)
def freeFlowVehicleTravelTime(context, section, funcVolume):
model = context.experiment.getModel()
vehicleName = context.userClass.getVehicle().getName()
SectionSpeed=section.getSpeed()
NbLanes=section.getNbFullLanes()
if vehicleName==”HGV” and SectionSpeed==96 and NbLanes==1: #If its a HGV on a single carriageway road with a 96kph/60mph limit
speed=80
else:
speed=SectionSpeed
distance=section.length3D() / 1000.0 # Km
t0 = distance/speed # hour
return t0
def freeFlowTravelTime(context, section, funcVolume):
model = context.experiment.getModel()
speed=SectionSpeed
distance=section.length3D() / 1000.0 # Km
t0 = distance/speed # hour
return t0
def vdf( context, section, funcVolume ):
#coefficients alpha and beta must be modified accordingly
alpha = 0.15
beta = 4.0
freeFlowVehicleTravelTime = freeFlowVehicleTravelTime(context, section, funcVolume)
freeFlowTravelTime=freeFlowTravelTime(context, section, funcVolume)
volume = funcVolume.getVolume()
addVolume = section.getAdditionalVolume()
capacity = section.getCapacity()
cost = max(freeFlowTravelTime * (1 + alpha * ((volume + addVolume) / capacity ) ** beta), freeFlowVehicleTravelTime)
return cost
Don’t forget you can then use table view to apply the function to all sections in the network. This can be found in Window > Windows > Table View. By going to the volume delay function column and changing the bottom row, all sections can be updated.
For more information on scripting and functions, please see qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/ScriptIntro.html
or attend one of our Scripting courses.
April 2017: Laura Torres, Sergi Pujadas and Emmanuel Bert explain the nuts and bolts of how to get your Aimsun videos looking sharp and running smoothly.
March 2022: A new feature introduced in Next 22 is the Transit Route Change traffic management action. This technical note will go over how to implement the action and ways in which it could be used.
SHARE
Aimsun Next 23
Aimsun Next 20.0.5
Aimsun Next 23
@manual {AimsunManual,
title = {Aimsun Next 23 User's Manual},
author = {Aimsun},
edition = {Aimsun Next 23.0.0},
address = {Barcelona, Spain},
year = {2023. [Online]},
month = {Accessed on: Month, Day, Year},
url = {https://docs.aimsun.com/next/23.0.0/},
}
Aimsun Next 20.0.5
@manual {AimsunManual,
title = {Aimsun Next 20.0.5 User's Manual},
author = {Aimsun},
edition = {Aimsun Next 20.0.5},
address = {Barcelona, Spain},
year = {2021. [In software]},
month = {Accessed on: Month, Day, Year},
url = {qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/Intro.html},
}
Aimsun Next 23
TY - COMP
T1 - Aimsun Next 23 User's Manual
A1 - Aimsun
ET - Aimsun Next Version 23.0.0
Y1 - 2023
Y2 - Accessed on: Month, Day, Year
CY - Barcelona, Spain
PB - Aimsun
UR - [In software]. Available: https://docs.aimsun.com/next/23.0.0/
Aimsun Next 20.0.5
TY - COMP
T1 - Aimsun Next 20.0.5 User's Manual
A1 - Aimsun
ET - Aimsun Next Version 20.0.5
Y1 - 2021
Y2 - Accessed on: Month, Day, Year
CY - Barcelona, Spain
PB - Aimsun
UR - [In software]. Available: qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/Intro.html