Path¶
- class passengersim.config.Path[source]¶
Bases:
BaseModelA travel path from an origin to a destination, comprised of one or more legs.
Attributes:
Optional numeric identifier for the path.
Identifier code for the path origin.
Identifier code for the path destination.
A numeric index representing the quality of the path.
Leg IDs of the legs comprising the path, in order from origin to destination.
Carrier of the first leg, derived when the containing Config is validated.
A tilde-separated string identifying the origin–destination market.
- path_id : int | None¶
Optional numeric identifier for the path.
- orig : str¶
Identifier code for the path origin.
This is typically the IATA airport code for the origin airport, but it may be a different code if the path is being used in a non-air-travel context, or if the airport is a hypothetical place that does not have an assigned IATA code.
- dest : str¶
Identifier code for the path destination.
This is typically the IATA airport code for the destination airport, but it may be a different code if the path is being used in a non-air-travel context, or if the airport is a hypothetical place that does not have an assigned IATA code.
- path_quality_index : float¶
A numeric index representing the quality of the path.
Lower values typically indicate a more desirable itinerary. This is typically the number of connections on the path but could also be some other quality measure.
- legs : list[int]¶
Leg IDs of the legs comprising the path, in order from origin to destination.
At least one leg is required.
- carrier : str | None¶
Carrier of the first leg, derived when the containing Config is validated.
This metadata supports config filtering and is not used in the simulation or included in serialized configs. Validation replaces any supplied value with the first leg’s carrier. A standalone Path defaults to None. After editing leg carriers or path legs, use
cfg = cfg.model_revalidate()to refresh it.
- property market_identifier : str¶
A tilde-separated string identifying the origin–destination market.
- Returns:
str – A string of the form
"<orig>~<dest>", e.g."JFK~LAX".