EMSR-BĀ¶
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 normal levels.
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/05-emsrb.yaml")
from passengersim.utils.codeview import show_file
show_file("network/05-emsrb.yaml")
include: - 01-base.yaml - 02-buyup.yaml - 03-ap.yaml simulation_controls: demand_multiplier: 1.0 airlines: - name: AL1 rm_system: rm_no_detruncation - name: AL2 rm_system: rm_no_detruncation db: write_items: - leg_final - fare_final - demand_final - bookings - bucket outputs: reports: - leg_forecasts - fare_class_mix - load_factors - bookings_by_timeframe - total_demand
InĀ [3]:
Copied!
sim = pax.Simulation.from_yaml([
"network/05-emsrb.yaml",
])
sim = pax.Simulation.from_yaml([
"network/05-emsrb.yaml",
])
InĀ [4]:
Copied!
summary = sim.run()
summary = sim.run()
Task Completed after 14.60 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-05.xlsx")
summary.to_xlsx("outputs/3mkt-05.xlsx")
Comparing against TargetsĀ¶
InĀ [10]:
Copied!
import targets
target = targets.load(5, sim.config)
import targets
target = targets.load(5, 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_carrier_revenues(comps)
contrast.fig_carrier_revenues(comps)
Out[12]:
InĀ [13]:
Copied!
contrast.fig_carrier_load_factors(comps)
contrast.fig_carrier_load_factors(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_leg_forecasts(comps, by_flt_no=101)
contrast.fig_leg_forecasts(comps, by_flt_no=101)
Out[15]:
InĀ [16]:
Copied!
contrast.fig_leg_forecasts(comps, by_flt_no=111, of=["mu", "sigma"])
contrast.fig_leg_forecasts(comps, by_flt_no=111, of=["mu", "sigma"])
Out[16]:
InĀ [17]:
Copied!
contrast.fig_bookings_by_timeframe(comps, by_class=True, by_carrier="AL1")
contrast.fig_bookings_by_timeframe(comps, by_class=True, by_carrier="AL1")
Out[17]: