EMSR-B with High Demand¶
In this example, we include product and advance purchase (AP) restrictions in the simulation, and have each airline use the leg-based EMSR-B algorithm to manage revenue. Demand is simulated at a level 10% higher than normal.
InĀ [1]:
Copied!
import passengersim as pax
pax.versions()
import passengersim as pax
pax.versions()
passengersim 0.51.dev11+g921f2a8 passengersim.core 0.51.dev2+g02d3ce20
InĀ [2]:
Copied!
from passengersim.utils.codeview import show_file
show_file("network/06-emsrb-high-demand.yaml")
from passengersim.utils.codeview import show_file
show_file("network/06-emsrb-high-demand.yaml")
include: - 01-base.yaml - 02-buyup.yaml - 03-ap.yaml simulation_controls: demand_multiplier: 1.1 carriers: - name: AL1 rm_system: rm_no_detruncation - name: AL2 rm_system: rm_no_detruncation
InĀ [3]:
Copied!
sim = pax.Simulation.from_yaml(
[
"network/06-emsrb-high-demand.yaml",
]
)
sim = pax.Simulation.from_yaml(
[
"network/06-emsrb-high-demand.yaml",
]
)
InĀ [4]:
Copied!
summary = sim.run(log_reports=False)
summary = sim.run(log_reports=False)
Task Completed after 2.08 seconds
InĀ [5]:
Copied!
summary.fig_carrier_revenues()
summary.fig_carrier_revenues()
Out[5]:
InĀ [6]:
Copied!
summary.fig_carrier_load_factors()
summary.fig_carrier_load_factors()
Out[6]:
InĀ [7]:
Copied!
summary.fig_fare_class_mix()
summary.fig_fare_class_mix()
Out[7]:
InĀ [8]:
Copied!
summary.fig_bookings_by_timeframe()
summary.fig_bookings_by_timeframe()
Out[8]:
InĀ [9]:
Copied!
summary.to_xlsx("outputs/3mkt-06.xlsx")
summary.to_xlsx("outputs/3mkt-06.xlsx")
Comparing against Targets¶
InĀ [10]:
Copied!
import targets
target = targets.load(6, sim.config)
import targets
target = targets.load(6, sim.config)
InĀ [11]:
Copied!
from passengersim import contrast
comps = contrast.Contrast(
{
"simulation": summary,
"target": target,
}
)
from passengersim import contrast
comps = contrast.Contrast(
{
"simulation": summary,
"target": target,
}
)
InĀ [12]:
Copied!
comps.fig_carrier_revenues()
comps.fig_carrier_revenues()
Out[12]:
InĀ [13]:
Copied!
comps.fig_carrier_load_factors()
comps.fig_carrier_load_factors()
Out[13]:
InĀ [14]:
Copied!
comps.fig_fare_class_mix()
comps.fig_fare_class_mix()
Out[14]:
InĀ [15]:
Copied!
comps.fig_bookings_by_timeframe(by_carrier="AL1", by_class=True)
comps.fig_bookings_by_timeframe(by_carrier="AL1", by_class=True)
Out[15]:
InĀ [16]:
Copied!
comps.fig_leg_forecasts(by_leg_id=101, of=["mu", "sigma"])
comps.fig_leg_forecasts(by_leg_id=101, of=["mu", "sigma"])
Out[16]:
InĀ [17]:
Copied!
comps.fig_leg_forecasts(by_leg_id=211, of=["mu", "sigma"])
comps.fig_leg_forecasts(by_leg_id=211, of=["mu", "sigma"])
Out[17]: