Parameters
Centralized management of the parameters.
biogeme.parameters module
Centralized management of the parameters.
Parameters are organized by section. Parameters within the same section must have different names
- author:
Michel Bierlaire
- date:
Fri Dec 2 12:17:38 2022
- class biogeme.parameters.NameSectionTuple(name, section)[source]
Bases:
NamedTuple
- name: str
Alias for field number 0
- section: str
Alias for field number 1
- class biogeme.parameters.Parameters[source]
Bases:
object
Parameters management
- add_parameter(parameter_tuple)[source]
Add one aprameter
- Parameters:
parameter_tuple (biogeme.default_parameters.ParameterTuple) – tuple containing the data associated with the parameter
- static check_parameter_value(the_tuple)[source]
Check if the value of the parameter is valid
- Parameters:
the_tuple (biogeme.default_parameters.ParameterTuple) – tuple to check
- Returns:
a boolean that is True if the value is valid. If not, diagnostics are provided.
- Return type:
tuple(bool, list(str))
- get_param_tuple(name, section=None)[source]
Obtain a tuple describing the parameter
- Parameters:
name (str) – name of the parameter
section (str) – section where the parameter is relevant
- Returns:
tuple containing the name, section and value of the parameter, or None if not found
- Return type:
- get_value(name, section=None)[source]
Get the value of a parameter. If the parameter appears in only one section, the name of the section can be ommitted.
- Parameters:
name (str) – name of the parameter
section (str) – section containing the parameter
- parameters_in_section(section_name)[source]
Returns the names of the parameters in a section
- Parameters:
section_name (str) – name of the section
- biogeme.parameters.format_comment(the_param)[source]
Format the content of the file, in particular the description of the parameter
- Parameters:
the_param (biogeme.default_parameters.ParameterTuple) – parmeter to format
- Returns:
formatted text
- Return type:
str