In certain situations, the speed limit for each vehicle type is different. 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 in Aimsun Next through the use of traffic management for microscopic and mesoscopic models, or within the delay functions for macroscopic models.
For microscopic and mesoscopic models, the speed for a road is set by the “Speed Limit” parameter. This can be reduced for a vehicle class through using a traffic management action called “Speed Reduction”, which you can also use to reduce turn speeds for larger vehicles.
Step 1: Add a traffic condition by going to the Project menu > Traffic Management > New > Traffic Condition
Step 2: Double-click on the Traffic Condition to open it. Select Activation Condition: Always and Apply to Warm up.
Step 3: Add a speed reduction action by right-clicking the Traffic Condition > New > Speed Reduction
Step 4: Select the speed reduction parameters.
In the speed reduction menu, you can specify which section/turn the action is applied to, what the new speed will be and choose to apply the action only to a certain vehicle class. In the example above, the Heavy class has been chosen which includes all vehicle types with vehicles over 7.5t.
The above method is valid for one section or one turn at a time; this would be an arduous task for a model with a large number of roads where HGVs have different speed limits. However, you can also choose to apply a speed change to a grouping of sections, a grouping of turns or a road type.
However, it may be the case that you want to apply a speed reduction to a subset of sections for a road type such as single-carriageway roads with a 60-mile-per-hour speed limit without having these be a separate road type.
The following script can be used to apply a speed reduction action for a given road type while also checking the number of lanes in the section. You need to specify the Traffic Condition name, new speed, vehicle class and road type and number of lanes for which the new speed would apply. The script will then iterate over all sections in the model of the specified road type and add a speed reduction action for each one.
The pseudocode for this is:
Get/Create Traffic Condition
Get vehicle class
For all sections:
If section.roadtype==roadtype and section.numberoflanes:
Create speed reduction action
Add speed reduction to Traffic Condition
'''This script applies a speed reduction for all sections in a road type. The User must specify the road type and the new speed'''
TrafficConditionName="Speed Reduction"
RoadTypeName="SingleCarriageway60" #96kph
VehicleClassName="Heavy Class"
NewSpeed=80 #50mph
NumberofLanes=1
def createSpeedReduction(section,Speed, VehicleClassname): #Add a speed reduction action
change = GKSystem.getSystem().newObject("GKSpeedChange", model)
change.setSection(section)
change.setSpeed(str(Speed)) #set the new speed
VehicleClassType=model.getType("GKVehicleClass")
VehicleClass=model.getCatalog().findByName(VehicleClassname,VehicleClassType)
change.setVehicleClass(VehicleClass) #add a filter for the vehicle class
return change
def NewTrafficCondition():#add a new TrafficConditionName
cmd = model.createNewCmd( model.getType( "GKTrafficCondition" ))
model.getCommander().addCommand( cmd )
res = cmd.createdObject()
res.setActivationType(GKSimulationEvent.eAlways) #set it to be active throughout the modelled period
applyToWarmUpAtt = model.getColumn("GKPolicy::applyOnWarmupAtt") #set it to be active in the warm up
res.setDataValue(applyToWarmUpAtt, QVariant(True))
return res
def GetVehicleClass( model, name): # get the vehicle class object
vehicleClassType=model.getType("GKVehicleClass")
vehicleClass = model.getCatalog().findByName(name, vehicleClassType)
if vehicleClass == None:
print ("No Vehicle Class Found")
return None
return vehicleClass
condition=model.getCatalog().findByName(TrafficConditionName, model.getType("GKTrafficCondition"))
if condition==None: #find condition or add new one
condition=NewTrafficCondition()
condition.setName(TrafficConditionName)
sections=model.getCatalog().getObjectsByType(model.getType("GKSection"))
for section in sections: #for all sections in road type, if the section has x lanes, make a new speed change in the given Traffic Condition
section=sections[section]
nooflanes=section.getNbFullLanes() #get the number of full lanes for this section
if section.getRoadType().getName()==RoadTypeName and nooflanes==NumberofLanes:
speedreductionaction=createSpeedReduction(section,NewSpeed,VehicleClassName)
speedreductionaction.setName("Speed reduction for section %s" %(section.getId()))
condition.addChange(speedreductionaction)
print ("new change")
print ("done")
Lastly, you need to apply the Traffic Condition to the Scenario, whether it has been added via a script or manually; open the scenario object and go to the Strategies and Conditions tab. Tick the new Traffic Condition.
Ronda Universitat 22 B
Barcelona 08007
Spain
t: +34 933 171 693
80 George St
Edinburgh EH2 3BU
UK
t: +44 7401 977 191
Waterhouse Square
138 Holborn
London EC1N 2ST
UK
t: +44 7401 977 191
t: 020 7193 7103
Paseo de la Castellana 77
Madrid 28046
Spain
t: +34 627 454 880
152 Elizabeth Street
Melbourne VIC 3000
Australia
t: +61 404 122 968
980 6th Avenue
2nd Floor
New York, NY 10018
USA
t: +1 917 267 8534
54 Rue de Clichy
Paris 75009
France
t: +33 (0) 1 86 95 41 52
36 Robinson Road, #02-01
Singapore 068877
t: +65 8186 5589
333 George Street
Level 13
Sydney, NSW 2000
Australia
t: +61 (2) 7208 7869
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.