ProBP with Daily Reoptimization¶
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
from passengersim.utils.codeview import show_file
In [3]:
Copied!
show_file("network/11-probp-daily.yaml")
show_file("network/11-probp-daily.yaml")
include: - 10-probp.yaml scenario: 3MKTproBP-Daily rm_systems: rm_probp: processes: DAILY: - step_type: forecastadjustment algorithm: timeframe kind: path - step_type: probp name: optimization simulation_controls: show_progress_bar: true db: write_items: - leg_final - fare_final - demand_final - bookings - bucket - pathclass - leg - demand - leg_daily - pathclass_daily snapshot_filters: - type: pro_bp title: ProBP Snapshot sample: [ 120, 290, 499 ] dcp: [ 63, 56, 21 ] flt_no: 111 airline: AL1 directory: snapshots/probp - type: forecast_adj title: Forecast Adj Snapshot sample: [ 120, 290, 499 ] flt_no: 111 airline: AL1 directory: snapshots/fcst-adj
In [4]:
Copied!
cfg = pax.Config.from_yaml([
"network/11-probp-daily.yaml",
])
cfg = pax.Config.from_yaml([
"network/11-probp-daily.yaml",
])
In [5]:
Copied!
sim = pax.Simulation(cfg)
sim = pax.Simulation(cfg)
In [6]:
Copied!
summary = sim.run()
summary = sim.run()
Task Completed after 82.25 seconds
In [7]:
Copied!
summary.fig_carrier_revenues()
summary.fig_carrier_revenues()
Out[7]:
In [8]:
Copied!
summary.fig_carrier_load_factors()
summary.fig_carrier_load_factors()
Out[8]:
In [9]:
Copied!
summary.fig_fare_class_mix()
summary.fig_fare_class_mix()
Out[9]:
In [10]:
Copied!
summary.fig_bookings_by_timeframe()
summary.fig_bookings_by_timeframe()
Out[10]:
In [11]:
Copied!
summary.to_xlsx("outputs/3mkt-11.xlsx")
summary.to_xlsx("outputs/3mkt-11.xlsx")
Comparing against Targets¶
In [12]:
Copied!
import targets
target = targets.load(11, cfg)
import targets
target = targets.load(11, cfg)
In [13]:
Copied!
from passengersim import contrast
comps = contrast.Contrast({
"simulation": summary,
"target": target,
})
from passengersim import contrast
comps = contrast.Contrast({
"simulation": summary,
"target": target,
})
In [14]:
Copied!
comps.fig_demand_to_come("mean") | comps.fig_demand_to_come("std")
comps.fig_demand_to_come("mean") | comps.fig_demand_to_come("std")
Out[14]:
In [15]:
Copied!
comps.fig_bookings_by_timeframe(by_carrier="AL1")
comps.fig_bookings_by_timeframe(by_carrier="AL1")
Out[15]:
In [16]:
Copied!
comps.fig_carrier_revenues()
comps.fig_carrier_revenues()
Out[16]:
In [17]:
Copied!
comps.fig_carrier_load_factors()
comps.fig_carrier_load_factors()
Out[17]:
In [18]:
Copied!
comps.fig_fare_class_mix()
comps.fig_fare_class_mix()
Out[18]:
In [19]:
Copied!
comps.fig_bookings_by_timeframe(by_carrier="AL1", by_class=True, source_labels=True)
comps.fig_bookings_by_timeframe(by_carrier="AL1", by_class=True, source_labels=True)
Out[19]:
In [20]:
Copied!
print(sim.path_names()[1])
comps.fig_path_forecasts(by_path_id=1, of=['mu', 'sigma', 'closed'])
print(sim.path_names()[1])
comps.fig_path_forecasts(by_path_id=1, of=['mu', 'sigma', 'closed'])
Path: BOS ORD (AL1:101 BOS-ORD)
Out[20]:
In [21]:
Copied!
print(sim.path_names()[5])
comps.fig_path_forecasts(by_path_id=5, of=['mu', 'sigma', 'closed'])
print(sim.path_names()[5])
comps.fig_path_forecasts(by_path_id=5, of=['mu', 'sigma', 'closed'])
Path: ORD LAX (AL1:111 ORD-LAX)
Out[21]:
In [22]:
Copied!
print(sim.path_names()[9])
comps.fig_path_forecasts(by_path_id=9, of=['mu', 'sigma', 'closed'])
print(sim.path_names()[9])
comps.fig_path_forecasts(by_path_id=9, of=['mu', 'sigma', 'closed'])
Path: BOS LAX (AL1:101 BOS-ORD, AL1:111 ORD-LAX)
Out[22]:
In [23]:
Copied!
comps.fig_bid_price_history(by_carrier="AL1", cap="some")
comps.fig_bid_price_history(by_carrier="AL1", cap="some")
Out[23]:
In [24]:
Copied!
comps.fig_bid_price_history(by_carrier="AL1", cap="some", show_stdev=1)
comps.fig_bid_price_history(by_carrier="AL1", cap="some", show_stdev=1)
Out[24]:
In [25]:
Copied!
from passengersim.extra.forecast_viz import fig_forecasts_and_bid_prices
from passengersim.extra.forecast_viz import fig_forecasts_and_bid_prices
In [26]:
Copied!
fig_forecasts_and_bid_prices(
sim,
trial = 0,
rrd = 63,
flt_no = 111,
)
fig_forecasts_and_bid_prices(
sim,
trial = 0,
rrd = 63,
flt_no = 111,
)
Out[26]:
In [27]:
Copied!
fig_forecasts_and_bid_prices(
sim,
trial = 0,
rrd = 63,
flt_no = 101,
)
fig_forecasts_and_bid_prices(
sim,
trial = 0,
rrd = 63,
flt_no = 101,
)
Out[27]: