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.

Parameters:

selections (Iterable[SelectionTuple] | None)

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

Return type:

Configuration

classmethod from_string(string_id)[source]

Ctor from a string representation

Parameters:

string_id (str) – string ID

Return type:

Configuration

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

Return type:

Configuration

get_html()[source]
Return type:

str

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: list[SelectionTuple]
set_of_controllers()[source]
Return type:

set[str]

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