displacement_history

passengersim.database.common_queries.displacement_history(cnx: Database, scenario: str, burn_samples: int = 100) DataFrame[source]

Compute average displacement cost history over all legs for each carrier.

This query requires that the simulation was run while recording leg details (i.e. with the leg flag set on Config.db.write_items), including displacement costs.

Parameters:
cnx : Database

scenario : str

burn_samples : int, default 100

The bid prices will be analyzed ignoring this many samples from the beginning of each trial.

Returns:

pandas.DataFrame – The resulting dataframe is indexed by carrier and days_prior, and has these columns:

  • displacement_mean: Average displacement cost across all samples and

    all legs

  • displacement_stdev: Sample standard deviation of displacement cost

    across all samples and all legs