EM Untruncation with Low 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. Additionally, the EM algorithm is employed to detruncate censored demand. Demand is simulated at a level 50% lower than normal.
In [1]:
Copied!
import passengersim as pax
pax.versions()
import passengersim as pax
pax.versions()
passengersim 0.18.1 passengersim.core 0.18.1
In [2]:
Copied!
from passengersim.utils.codeview import show_file
show_file("network/07-untrunc-em-low-demand.yaml")
from passengersim.utils.codeview import show_file
show_file("network/07-untrunc-em-low-demand.yaml")
include: - 08-untrunc-em.yaml simulation_controls: demand_multiplier: 0.5
In [3]:
Copied!
sim = pax.Simulation.from_yaml([
"network/07-untrunc-em-low-demand.yaml",
])
sim = pax.Simulation.from_yaml([
"network/07-untrunc-em-low-demand.yaml",
])
In [4]:
Copied!
summary = sim.run()
summary = sim.run()
Task Completed after 19.09 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-07.xlsx")
summary.to_xlsx("outputs/3mkt-07.xlsx")
Comparing against Targets¶
In [10]:
Copied!
import targets
target = targets.load(7, sim.config)
import targets
target = targets.load(7, 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!
contrast.fig_bookings_by_timeframe(comps, by_carrier="AL1")
contrast.fig_bookings_by_timeframe(comps, by_carrier="AL1")
Out[12]:
In [13]:
Copied!
contrast.fig_carrier_revenues(comps)
contrast.fig_carrier_revenues(comps)
Out[13]:
In [14]:
Copied!
contrast.fig_fare_class_mix(comps)
contrast.fig_fare_class_mix(comps)
Out[14]:
In [15]:
Copied!
contrast.fig_bookings_by_timeframe(comps, by_carrier="AL1", by_class=True)
contrast.fig_bookings_by_timeframe(comps, by_carrier="AL1", by_class=True)
Out[15]: