Config

class passengersim.config.Config[source]

Bases: YamlConfig

Attributes:

dataframes

Accessor for getting selected configuration settings as a Pandas DataFrame.

scenario

Name for this scenario.

simulation_controls

Controls that apply broadly to the overall simulation.

db

See [passengersim.config.DatabaseConfig][] for detailed documentation.

outputs

See [passengersim.config.OutputConfig][] for detailed documentation.

rm_systems

The revenue management systems used by the carriers in this simulation.

blf_curves

Booked Load Factor curves

frat5_curves

FRAT5 curves are used to model sellup rates in Q-forecasting

load_factor_curves

FRAT5 curves are used to model sellup rates in Q-forecasting

todd_curves

Time of Day curves

choice_models

Several choice models are programmed behind the scenes.

carriers

A list of carriers.

places

A list of places (airports, vertiports, other stations).

circuity_rules

Specifies exceptions and the default rule

classes

A list of fare classes.

dcps

A list of DCPs (data collection points).

booking_curves

Booking curves

legs

demands

fares

paths

markets

other_controls

markets_dict

snapshot_filters

dwm_tolerance

Each item is a dictionary of {min_distance, max_distance, business, leisure} The segments are named, so you can add more in the future, and they will be matched agains the Demand segment name by the loader

raw_license_certificate

license_certificate

Methods:

get_frat5_curve(name[, deep_copy])

Get a Frat5 curve from this configuration (if defined) or from the standard set.

get_place(name, *[, error_if_missing])

Get a place from the config, or look it up if not defined.

model_revalidate()

Revalidate the passengersim Config instance.

find_differences(other, *[, include, exclude])

Find the differences between two Config objects.

add_output_prefix(prefix[, spool_format])

Add a prefix directory to all simulation output files.

preprocess()

Conduct cleaning and preprocessing on this Config.

dataframes : ClassVar

Accessor for getting selected configuration settings as a Pandas DataFrame.

scenario : str

Name for this scenario.

The scenario name is helpful when writing different simulations to the same database so you can uniquely identify and query results for a particular scenario.

simulation_controls : SimulationSettings

Controls that apply broadly to the overall simulation.

See [SimulationSettings][passengersim.config.SimulationSettings] for detailed documentation.

db : DatabaseConfig

See [passengersim.config.DatabaseConfig][] for detailed documentation.

outputs : OutputConfig

See [passengersim.config.OutputConfig][] for detailed documentation.

rm_systems : DictOfNamed[RmSystem]

The revenue management systems used by the carriers in this simulation.

See [RM Systems][rm-systems] for details.

blf_curves : DictOfNamed[BlfCurve]

Booked Load Factor curves

frat5_curves : DictOfNamed[Frat5Curve]

FRAT5 curves are used to model sellup rates in Q-forecasting

get_frat5_curve(name: str, deep_copy: bool = False) Frat5Curve[source]

Get a Frat5 curve from this configuration (if defined) or from the standard set.

PassengerSim has a number of “standard” Frat5 curves available, which do not need to be explicitly defined in your config. These standard curves run over a 63 day booking curve and follow those used historically in PODS.

Parameters:
name : str

The name of the Frat5 curve to retrieve. If this curve is not explicitly defined in the config, it will be loaded from the standard set of curves.

deep_copy : bool, default False

Whether to return a deep copy of the curve. This can be useful if you want to modify the curve for a particular Carrier without affecting other Carriers that use the same curve.

Returns:

Frat5Curve

Raises:

KeyError – If the name is not a defined Frat5 curve in this configuration, nor a standard name.

load_factor_curves : DictOfNamed[LoadFactorCurve]

FRAT5 curves are used to model sellup rates in Q-forecasting

todd_curves : DictOfNamed[ToddCurve]

Time of Day curves

choice_models : DictOfNamed[ChoiceModel]

Several choice models are programmed behind the scenes.

The choice_models option allows the user to set the parameters used in the utility model for a particular choice model. There are two choice models currently programmed. 1. PODS-like 2. MNL, using the Lurkin et. al. paper (needs more testing and pdating)

Need to explaining more here

carriers : DictOfNamed[Carrier]

A list of carriers.

One convention is to use Airline1, Airline2, … to list the carriers in the network. Another convention is to use IATA industry-standard two-letter airline codes. See the [IATA code search](https://www.iata.org/en/publications/directories/code-search/) for more information.

places : DictOfNamed[Place]

A list of places (airports, vertiports, other stations).

get_place(name: str, *, error_if_missing: bool = True) Place | None[source]

Get a place from the config, or look it up if not defined.

Parameters:
name : str

The name of the place to retrieve. If this place is not defined, it is assumed the name is an IATA code, and it will be loaded from the standard set of places.

error_if_missing : bool, default True

Whether to raise an error if the place is not found in the config or as a standard place. If False, this method will return None instead of raising an error when the place is not found.

Returns:

Place

Raises:

KeyError – If the name is not a defined place in this configuration, and cannot be found as an IATA code in the standard set of places.

circuity_rules : ListOfNamed[CircuityRule]

Specifies exceptions and the default rule

classes : list[str]

A list of fare classes.

One convention is to use Y0, Y1, … to label fare classes from the highest fare (Y0) to the lowest fare (Yn). You can also use Y, B, M, H,… etc. An example of classes is below.

Example

```{yaml} classes:

  • Y0

  • Y1

  • Y2

  • Y3

  • Y4

  • Y5

```

dcps : list[int]

A list of DCPs (data collection points).

The DCPs are given as integers, which represent the number of days before departure. An example of data collection points is given below. Note that typically as you get closer to day of departure (DCP=0) the number of days between two consecutive DCP periods decreases. The DCP intervals are shorter because as you get closer to departure, customer arrival rates tend to increase, and it is advantageous to forecast changes in demand for shorter intervals.

Example

`{yaml} dcps: [63, 56, 49, 42, 35, 31, 28, 24, 21, 17, 14, 10, 7, 5, 3, 1] `

booking_curves : DictOfNamed[BookingCurve]

Booking curves

The booking curve points typically line up with the DCPs.

Example

```{yaml} booking_curves:

  • name: c1 curve:

    63: 0.06 56: 0.11 49: 0.15 42: 0.2 35: 0.23 31: 0.25 28: 0.28 24: 0.31 21: 0.35 17: 0.4 14: 0.5 10: 0.62 7: 0.7 5: 0.78 3: 0.95 1: 1.0

legs : Annotated[list[Leg], AfterValidator(make_filterable)]
demands : Annotated[list[Demand], AfterValidator(make_filterable)]
fares : Annotated[list[Fare], AfterValidator(make_filterable)]
paths : Annotated[list[Path], AfterValidator(make_filterable)]
markets : Annotated[list[Market], AfterValidator(make_filterable)]
other_controls : dict[str, Any]
property markets_dict
snapshot_filters : list[SnapshotFilter]
dwm_tolerance : list[dict]

Each item is a dictionary of {min_distance, max_distance, business, leisure} The segments are named, so you can add more in the future, and they will be matched agains the Demand segment name by the loader

raw_license_certificate : bytes | None | bool
property license_certificate
tags : dict[str, Any]

Tags that can be used in format strings in the config.

model_revalidate() Self[source]

Revalidate the passengersim Config instance.

find_differences(other: Config, *, include: IncEx = None, exclude: IncEx = None) dict[source]

Find the differences between two Config objects.

add_output_prefix(prefix: Path, spool_format: str = '%Y%m%d-%H%M')[source]

Add a prefix directory to all simulation output files.

preprocess() Self[source]

Conduct cleaning and preprocessing on this Config.

This will run the following steps:

  • connection builder

  • compute delta-t for all markets as needed

  • assign standard TODD curves to all demands if simulation_controls.use_standard_todd_curves