EMSR-B 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. 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
The yaml file for this example contains an explicit include
instruction directly in the file.
This emulates calling multiple file names in the from_yaml
command, but the other file references
are written directly into the code, so that groups of configurations can be managed together
easily, without necessarily needing the user to carefully assemble the correct set of filenames
every time they run the simulation.
In [2]:
Copied!
from passengersim.utils.codeview import show_file
show_file("network/04-emsrb-low-demand.yaml")
from passengersim.utils.codeview import show_file
show_file("network/04-emsrb-low-demand.yaml")
include: - 01-base.yaml - 02-buyup.yaml - 03-ap.yaml simulation_controls: demand_multiplier: 0.5 airlines: - name: AL1 rm_system: rm_no_detruncation - name: AL2 rm_system: rm_no_detruncation
In [3]:
Copied!
sim = pax.Simulation.from_yaml([
"network/04-emsrb-low-demand.yaml",
])
sim = pax.Simulation.from_yaml([
"network/04-emsrb-low-demand.yaml",
])
In [4]:
Copied!
summary = sim.run()
summary = sim.run()
Task Completed after 17.43 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-04.xlsx")
summary.to_xlsx("outputs/3mkt-04.xlsx")
Comparing against Targets¶
In [10]:
Copied!
import targets
target = targets.load(4, sim.config)
import targets
target = targets.load(4, 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]: