unlimited_circuity¶
-
passengersim.connection_builder.circuity.unlimited_circuity(places: dict[str, Airport], legs: tuple[Leg, ...], dest: str | None =
None, iteration: int =0) bool[source]¶ Allow unlimited circuity in the network.
This function can be used as a simple way to disable circuity checks, for example in testing or in cases where the user does not have strong preferences about circuity and wants to allow all paths. Note that this will likely lead to a very large number of possible paths, which may increase computation time and memory usage.
- Parameters:
- places : dict[str, Airport]¶
A dictionary mapping airport codes to Airport objects containing their location information. Not used by this implementation, but required by the
CircuityFuncinterface.- legs : tuple[Leg, ...]¶
A tuple of Leg objects representing the sequence of legs in the proposed path. Must contain at least one leg.
- dest : str | None, optional¶
The code of the destination airport. Not used by this implementation, but required by the
CircuityFuncinterface. Defaults to None.- iteration : int, optional¶
The current iteration of the connection builder. When greater than zero,
StopIterationis raised to signal that no new paths will be discovered in subsequent iterations. Defaults to 0.
- Returns:
bool – Always returns
True(all paths are accepted) on the first iteration.- Raises:
ValueError – If legs is empty.
StopIteration – If iteration is greater than zero, signaling that further iterations will not produce new paths.