Contrasting Runs¶
Often when we run PassengerSim, we're not really interested in just the result of
a simulation run -- we are interested in how the results change across two or more
slightly different runs. For this kind of analysis, PassengerSim offers a
Contrast tool, which
bundles multiple
SimulationTables
objects together, and provides comparison figures mirroring many of the single-simulation
visualizations.
import passengersim as pax
from passengersim.contrast import Contrast
summary0 = pax.from_file(pax.demo_output("US25/baseline"))
summary1 = pax.from_file(pax.demo_output("US25/high-demand"))
comps = Contrast({"Baseline": summary0, "High Demand": summary1})
comps.fig_carrier_revenues()
Carrier Load Factors¶
Contrast.fig_carrier_load_factors.
Display the average system load factors by carrier. The system load factor is calculated based on ASM and RPM figures for the carrier, which weights larger capacity vehicles and longer distance legs more heavily, to reflect their larger relative importance in evaluating carrier performance.
comps.fig_carrier_load_factors()
comps.fig_carrier_load_factors(load_measure="avg_leg_lf")
Carrier Yields¶
Display the average yield (revenue per passenger mile) by carrier.
comps.fig_carrier_yields()
comps.fig_fare_class_mix()
Bookings by Timeframe¶
Contrast.fig_bookings_by_timeframe.
Display the bookings by timeframe, optionally filtered by carrier and broken down by fare class.
comps.fig_bookings_by_timeframe(by_carrier="Bison")
comps.fig_bookings_by_timeframe(by_carrier="Bison", by_class=True, source_labels=True)
Demand to Come¶
Display the demand to come (total demand, not just bookings) over time, showing how anticipated demand evolves as the departure date approaches. This figure can show the mean, standard deviation, or both.
comps.fig_demand_to_come(["mean", "std"])
Bid Prices¶
Contrast.fig_bid_price_history.
Display the bid price history over time, showing how bid prices evolve as the departure date approaches across different simulation scenarios.
comps_3mkt.fig_bid_price_history()
Displacement Costs¶
Contrast.fig_displacement_history.
Display the displacement cost history over time, showing how displacement costs evolve as the departure date approaches across different simulation scenarios. Note that not all bid price based RM algorithms compute a displacement cost, in which case these values will be reported as zeros.
comps_3mkt.fig_displacement_history()