check_connections

passengersim.connection_builder.checking.check_connections(sim: Simulation | SimulationEngine, min_paths_per_market: int = 1) None[source]

Validate that the connection structure of a simulation is well-formed.

Checks that every demand has a corresponding market, and that every market has at least the required minimum number of itinerary paths. Collects all detected problems before raising so that every issue is reported at once.

Parameters:
sim : Simulation or SimulationEngine

The simulation (or underlying engine) whose connections are to be checked.

min_paths_per_market : int, optional

The minimum number of paths that each market must contain. Defaults to 1.

Raises:

ValueError – If any problems are found, a ValueError is raised that lists every detected problem. Problems include markets that are missing for a demand, markets with no paths, and markets whose path count is below min_paths_per_market.