biogeme.catalog.catalog module

Defines a catalog of expressions that may be considered in a specification

Michel Bierlaire Wed Apr 16 18:35:02 2025

class biogeme.catalog.catalog.Catalog(catalog_name, named_expressions, controlled_by=None)[source]

Bases: MultipleExpression

Catalog of expressions that are interchangeable. Only one of them defines the specification. They are designed to be modified algorithmically by a controller.

Parameters:
classmethod from_dict(catalog_name, dict_of_expressions, controlled_by=None)[source]

Ctor using a dict instead of a list.

Python used not to guarantee the order of elements of a dict, although, in practice, it is always preserved. If the order is critical, it is better to use the main constructor. If not, this constructor provides a more readable code.

Parameters:
  • catalog_name (str) – name of the catalog

  • dict_of_expressions (dict[str, Expression]) – dict associating the name of an expression and the expression itself.

  • controlled_by (Controller | None) – Object controlling the selection of the specifications.

Return type:

Catalog

get_all_controllers()[source]
Provides all controllers controlling the specifications of

a multiple expression

Returns:

a set of controllers

Return type:

set(biogeme.controller.Controller)

get_iterator()[source]

Obtain an iterator on the named expressions

Return type:

Iterator[NamedExpression]

selected()[source]

Return the selected expression and its name

Returns:

the name and the selected expression

Return type:

NamedExpression