.set_parameters+

BPR link performance function method

Description

This .set_parameters allows you to set the BPR function’s parameters for specific link segments in case the network wide, mode and/or link segment type parameters do not suffice.

It is highly recommended to configure BPR parameters based on the link segment type rather than setting them for individual links. It is best practice to - in that case - create a new link segment type instead to reverting to this approach.

Signature

.set_parameters(alpha, beta, link_segment_xml_id)

with

Parameter Type Unit Compulsory Description
alpha float None YES Alpha parameter of BPR function
beta float None YES Beta parameter of BPR function
link_segment_xml_id string None YES Link segment (XML) id to relate parameter to

Return type

None

Example 1

Set only network wide defaults

from planit import *

# prep
planit_instance = Planit()
planit_instance.project.set(TrafficAssignment.TRADITIONAL_STATIC)

# set physical cost to BPR link performance function
planit_instance.project.assignment.set(PhysicalCost.BPR)

# specifically set the alpha and beta for link segment with XML id of "3"
alpha = 0.87
beta = 5
planit_instance.project.assignment.physical_cost.set_parameters(alpha, beta, "3")

See also

N/A

Source code

Class BPRCostWrapper in projectwrappers.py

Last modified January 1, 0001