Configuration

Represents the configuration of a multiple expression.

biogeme.configuration module

Represents the configuration of a multiple expression

author:

Michel Bierlaire

date:

Sun Apr 2 14:15:17 2023

class biogeme.configuration.Configuration(selections=None)[source]

Bases: object

Represents the configuration of a multiple expression. It is internally represented as a sorted list of tuples.

__eq__(other)[source]

Return self==value.

__init__(selections=None)[source]

Ctor.

Parameters:

selections – list of tuples, where each of them associates a controller name with the selected configuration

classmethod from_dict(dict_of_selections)[source]

Ctor from dict

Parameters:

dict_of_selections (dict(str: str)) – dict associating a catalog name with the selected configuration

classmethod from_string(string_id)[source]

Ctor from a string representation

Parameters:

string_id (str) – string ID

classmethod from_tuple_of_configurations(tuple_of_configurations)[source]

Ctor from tuple of configurations that are merged together.

In the presence of two different selections for the same catalog, the first one is selected, and the others ignored.

Parameters:

tuple_of_configurations (tuple(Configuration)) – tuple of configurations to merge

get_html()[source]
get_selection(controller_name)[source]

Retrieve the selection of a given controller

Parameters:

controller_name (str) – name of the controller

Returns:

name of the selected config, or None if controller is not known

Return type:

str

get_string_id()[source]

The string ID is a unique string representation of the configuration

Returns:

string ID

Return type:

str

property selections
set_of_controllers()[source]
class biogeme.configuration.SelectionTuple(controller, selection)[source]

Bases: NamedTuple

Parameters:
  • controller (str) –

  • selection (str) –

controller: str

Alias for field number 0

selection: str

Alias for field number 1