In Aimsun Next, both static assignments (private vehicles) and transit assignments (passengers) can take trip purpose into consideration when evaluating a path cost.
In Technical Note #53, we gave some tips on how to modify the cost for static assignment based on the vehicle type. Demands in static models are coded through OD matrices and these are given by user class (vehicle type + trip purpose). Accessing the trip purpose in a volume delay function, turn penalty function, and junction delay function is, therefore, as easy as accessing the vehicle type:
vehicle = context.userClass.getPurpose()
For example, in a BPR function that has an additional term for tolls, we can decrease the vehicle VoT (value of time), which converts a toll (coded in the first user defined cost) into time units including a weight, when the trip purpose is ‘Work’.
def vdf(context, section, funcVolume):
vehicleName = context.userClass.getVehicle().getName()
tripPurposeName = context.userClass.getPurpose().getName()
vehicleVoT = context.userClass.getVehicle().getValueOfTimeMean()
if vehiclePurpose==”Work”: #If trip purpose is “Work”
vehicleVoT = 0.5 * vehicleVoT
#coefficients alpha and beta must be modified accordingly
alpha = 0.15
beta = 4.0
freeflowTravelTime = ( 60.0 / section.getSpeed() ) * section.length3D() / 1000.0
volume = funcVolume.getVolume()
addVolume = section.getAdditionalVolume()
capacity = section.getCapacity()
cost = freeflowTravelTime * ( 1 + alpha * ((volume + addVolume) / capacity ) ** beta) + vehicleVoT * section.getUserDefinedCost()
return cost
Another option, if you want to define a different VoT or VOC (vehicle operating cost) per vehicle type and trip purpose, is to define these values as an attribute of the User Class instead of using the Vehicle Type parameter. Activate the Types window, find the User Class type and double-click on User Class (GKUserClass) to access the Type Editor.
Click the Add button and create a new attribute of the type Double.
This attribute will now be available for any User Class. You can find it in the Attributes tab in the User Class Editor. Just fill in the values and access this attribute in the cost functions (for section, turn, or both).
col = section.getModel().getColumn("GKUserClass::VoTperPurpose")
VoT = context.userClass.getDataValueDouble(col)
Transit cost functions can also access the trip purpose through the context parameter, and can access user class attributes, so you can still use the approaches presented above. In addition, another approach is available. In the User Class editor, for each Vehicle Type and Trip Purpose, a set of weights for Transit is available. These weights are automatically taken into account when adding up all cost components for the evaluation of the total cost of a transit trip.
For more information on static private and transit functions, please see qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/FunctionEditing.html or attend one of our Macroscopic or Strategic Modeling courses.
For more information on scripting, please see qthelp://aimsun.com.aimsun.20.0/doc/UsersManual/ScriptIntro.html or attend one of our Scripting courses.
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.