clean_restrictions

passengersim.transforms.restrictions.clean_restrictions(cfg: Config) Config[source]

Remove unused restrictions from choice models and fares.

This function removes any restrictions from choice models that are not present in any fare, as they are basically superfluous. It also removes any restrictions from fares that are not present in any choice model, for the same reason. This helps to keep the configuration clean reduces memory usage by not storing unnecessary restrictions.

Parameters:
cfg : Config

The configuration object containing fares and choice models.

Returns:

Config – The cleaned configuration object with unused restrictions removed.