Default Stop Criterion

Default Stop Criterion implementation

Description

Reference documentation for the default stop criterion implementation.

The default stop criterion implementation allows you to set two criteria for termination of the algorithm it is registered on, e.g., traffic assignment equilibrium search. These comprise an epsilon for the found (relative) gap and a cut-off based on the number of iterations conducted. When either criterion is met, the algorithm is flagged for termination and stops.

Defaults

Name Default Type Unit
DEFAULT_EPSILON 0.001 float None
DEFAULT_MAX_ITERATIONS 500 float None

Methods

The default stop criterion exposes the following methods

Name Description
set_max_iterations(+) Set the maximum number of iterations
get_max_iterations() Collect the maximum number of iterations
set_epsilon(+) Set the upper bound epsilon value
get_epsilon() Collect the upper bound epsilon value

Properties

This class has no properties (yet)

Example 1

from planit import *

# choose to run Planit with a traditional static traffic assignment method
planit_instance = Planit()
planit_instance.project.set(TrafficAssignment.TRADITIONAL_STATIC)

# set the maximum number of allowed iterations to 20 
planit_instance.project.assignment.gap_function.stop_criterion.set_max_iterations(20)

See also

Traffic Assignment on what traffic assignment methods are available
Gap Function gap function implementations utilising a stop criterion

Source code

Class StopCriterionWrapper in projectwrappers.py


.get_epsilon()

A Default Stop Criterion method

.get_max_iterations()

A Default Stop Criterion method

.set_epsilon(+)

A Default Stop Criterion method

.set_max_iterations(+)

A Default Stop Criterion method

Last modified January 1, 0001