set_averaged(+)
A Norm Based Relative Gap Function method
Description
Set the flag to either apply averaging on the computed norm or not. When applied the norm is divided by the number of elements, otherwise it is not.
Signature
.set_averaged(flag)
with
Parameter | Type | Unit | Compulsory | Description |
---|---|---|---|---|
flag |
boolean |
None |
YES | when TRUE average, when FALSE do not |
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)
# disable averaging the norm, this impacts the result, so likely the gap accepted
# by the stop criterion as well
planit_instance.project.assignment.gap_function.set_averaged(False)
See also
Traffic Assignment on what traffic assignment methods are available
StopCriterion default implementation
Source code
Class GapFunctionWrapper
in projectwrappers.py