set_norm(+)

A Norm Based Relative Gap Function method
Description

Set the norm to apply, where for example taking the norm 2 results in squaring all differences and taking the square root.

Signature

.set_norm(norm_p)

with

Parameter Type Unit Compulsory Description
norm_p integer None YES The norm to apply

Return type

None

Example 1

from planit import *

# choose to run PLANit with a the Static Link Transmission Model assignment method
# This has the norm based gap as a default already
planit_instance = Planit()
planit_instance.project.set(TrafficAssignment.SLTM)

# while not needed it can be set explicitly via
# planit_instance.project.assignment.set(GapFunction.NORM_BASED) 

# change the norm to use from 1 to 2
planit_instance.project.assignment.gap_function.set_norm(2)

See also

Traffic Assignment on what traffic assignment methods are available
StopCriterion default implementation

Source code

Class GapFunctionWrapper in projectwrappers.py