How to define different costs per trip purpose in static models

Technical Note #55
January 2021

By Marga Delgado

In static models, you might want to include the different perceptions of cost that network users will have about certain network components, depending on the purpose of the trip. A commuter may consider using a toll road, but may be more reluctant to use it when going shopping.

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.

 

 

How to define different costs per trip purpose in static models

 

 

Click the Add button and create a new attribute of the type Double.

 

 

How to define different costs per trip purpose in static models

 

 

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).

 

 

How to define different costs per trip purpose in static models
				
					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.

 

 

How to define different costs per trip purpose in static models

 

 

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.

More technical notes

How to use Matrix Contents

March 2017: Marga Delgado shows you how to use Contents to group matrices into subfolders, which is particularly convenient when working with multiple matrices.

  • Got a question? Get in touch.

    We are here to help!

SHARE

Cite Aimsun Next

Aimsun Next 24

Aimsun (2024). Aimsun Next 24 User’s Manual, Aimsun Next Version 24.0.0, Barcelona, Spain. Accessed on: April. 16, 2024. [Online].

Available: https://docs.aimsun.com/next/24.0.0/

Aimsun Next 24

@manual {AimsunManual,
title = {Aimsun Next 24 User’s Manual},
author = {Aimsun},
edition = {Aimsun Next 24.0.0},
address = {Barcelona, Spain},
year = {2024. [Online]},
month = {Accessed on: Month, Day, Year},
url = {https://docs.aimsun.com/next/24.0.0},
}​​​​​​​​​​​​​​​

Aimsun Next 24

TY – COMP
T1 – Aimsun Next 24 User’s Manual
A1 – Aimsun
ET – Aimsun Next Version 24.0.0
Y1 – 2024
Y2 – Accessed on: Month, Day, Year
CY – Barcelona, Spain
PB – Aimsun
UR – [In software]. Available:
https://docs.aimsun.com/next/24.0.0/