NA26 Baseline Network¶
This page loads the NA26 network and reviews its schedule, demand, and available paths before simulation. See the NA26 overview for a description of the network.
import NA26
cfg = NA26.load_config("latest")
Loading network config file /Users/jpn/Git/pax/networks/NA26/configs/v26.9.B
/Users/jpn/Git/pax/.venv/lib/python3.12/site-packages/pydantic/main.py:732: UserWarning: Only 120 usable samples remain after burning 50 of 70 samples across 6 trials; at least 750 usable samples are recommended to ensure meaningful results.
return cls.__pydantic_validator__.validate_python(
cfg.fig_route_map()
cfg.fig_demand_vs_capacity()
These figures show departing and arriving totals for seats on all carriers and total average demand for all markets.
Points are colored by the airport’s path flow share. This is computed by taking an enumeration of all paths that utilize each airport, and finding the fraction of all those paths where this airport is a connection rather than the path origin or destination. We expect hubs to have relatively high path flow shares, focus cities (if any carriers are not operating a strict hub-and-spoke system) to have lower values, and spokes to have low or zero path flow shares.
A red diagonal 1:1 reference line is also included in each panel. If the network is well calibrated the spoke airports should have marks close to or slightly below the red line, while hub airports can be well above the line (i.e. local passengers at that airport need not be available in sufficient quantity to fill planes at that airport).
cfg.fig_duration_by_distance()
This figure shows the distance compared against the block time for each leg. It is useful to catch encoding problems for the network schedule, which might have impacts on customer choice behaviour (i.e. if one leg is unusually fast or slow compared to others in the same market.). Each leg is marked with a wedge showing the average bearing for the great circle routing. In this network we can see a reasonable setup where eastbound legs tend to have slightly higher speeds and shorter block times.
cfg.fig_reference_price_by_distance()
cfg.fig_booking_curves()
We can use a schedule viewer to review the schedule at any airport, although reviewing the hub airports will be most useful. Clicking on any leg in these figures will highlight all available connections at this airport that use that leg.
cfg.fig_hub_schedule("DEN")
cfg.fig_hub_schedule("ORD")
We can also review the complete set of available paths for any specific market.
cfg.fig_market_schedule("SLC", "ATL")
cfg.dataframes.legs
| orig | dest | orig_timezone | dest_timezone | carrier | fltno | distance | capacity | date | dep_time | arr_time | dep_time_offset | arr_time_offset | dep_hour_local | arr_hour_local | duration_minutes | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| leg_id | ||||||||||||||||
| 5 | DEN | ATL | America/Denver | America/New_York | Bison | 5 | 1199.0 | 150 | 2023-01-10 00:00:00+00:00 | 1673370300 | 1673381160 | -25200 | -18000 | 10.083333 | 15.100000 | 181 |
| 15 | DEN | ATL | America/Denver | America/New_York | Bison | 15 | 1199.0 | 150 | 2023-01-10 00:00:00+00:00 | 1673383260 | 1673393820 | -25200 | -18000 | 13.683333 | 18.616667 | 176 |
| 22 | DEN | ATL | America/Denver | America/New_York | Bison | 22 | 1199.0 | 150 | 2023-01-10 00:00:00+00:00 | 1673397660 | 1673408220 | -25200 | -18000 | 17.683333 | 22.616667 | 176 |
| 87 | ATL | DEN | America/New_York | America/Denver | Bison | 87 | 1199.0 | 150 | 2023-01-10 00:00:00+00:00 | 1673359860 | 1673372640 | -18000 | -25200 | 9.183333 | 10.733333 | 213 |
| 88 | ATL | DEN | America/New_York | America/Denver | Bison | 88 | 1199.0 | 150 | 2023-01-10 00:00:00+00:00 | 1673385900 | 1673398980 | -18000 | -25200 | 16.416667 | 18.050000 | 218 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 354 | SLC | ORD | America/Denver | America/Chicago | Eagle | 354 | 1249.0 | 166 | 2023-01-10 00:00:00+00:00 | 1673365200 | 1673376600 | -25200 | -21600 | 8.666667 | 12.833333 | 190 |
| 355 | SLC | ORD | America/Denver | America/Chicago | Eagle | 355 | 1249.0 | 179 | 2023-01-10 00:00:00+00:00 | 1673380500 | 1673391900 | -25200 | -21600 | 12.916667 | 17.083333 | 190 |
| 417 | ORD | SLC | America/Chicago | America/Denver | Eagle | 417 | 1249.0 | 179 | 2023-01-10 00:00:00+00:00 | 1673362800 | 1673376420 | -21600 | -25200 | 9.000000 | 11.783333 | 227 |
| 426 | ORD | SLC | America/Chicago | America/Denver | Eagle | 426 | 1249.0 | 150 | 2023-01-10 00:00:00+00:00 | 1673388000 | 1673401080 | -21600 | -25200 | 16.000000 | 18.633333 | 218 |
| 441 | ORD | SLC | America/Chicago | America/Denver | Eagle | 441 | 1249.0 | 166 | 2023-01-10 00:00:00+00:00 | 1673403480 | 1673416800 | -21600 | -25200 | 20.300000 | 23.000000 | 222 |
452 rows × 16 columns
import pandas as pd
def check_market_windows(cfg):
legs_df = cfg.dataframes.legs
earliest_dep = {}
latest_dep = {}
earliest_arr = {}
latest_arr = {}
for p in cfg.paths:
mkt = p.market_identifier
deptime = legs_df.loc[p.legs[0]].dep_time
arrtime = legs_df.loc[p.legs[-1]].arr_time
if mkt in earliest_dep:
earliest_dep[mkt] = min(earliest_dep[mkt], deptime)
latest_dep[mkt] = max(latest_dep[mkt], deptime)
earliest_arr[mkt] = min(earliest_arr[mkt], arrtime)
latest_arr[mkt] = max(latest_arr[mkt], arrtime)
else:
earliest_dep[mkt] = deptime
latest_dep[mkt] = deptime
earliest_arr[mkt] = arrtime
latest_arr[mkt] = arrtime
df = pd.DataFrame.from_dict(
{
"earliest_dep": earliest_dep,
"latest_dep": latest_dep,
"earliest_arr": earliest_arr,
"latest_arr": latest_arr,
}
)
df["dep_hours_span"] = (df["latest_dep"] - df["earliest_dep"]) / 3600
df["arr_hours_span"] = (df["latest_arr"] - df["earliest_arr"]) / 3600
return df
check_market_windows(cfg)
| earliest_dep | latest_dep | earliest_arr | latest_arr | dep_hours_span | arr_hours_span | |
|---|---|---|---|---|---|---|
| ATL~CDG | 1673359860 | 1673383440 | 1673407800 | 1673430000 | 6.550000 | 6.166667 |
| ATL~DEN | 1673350200 | 1673385900 | 1673372100 | 1673413080 | 9.916667 | 11.383333 |
| ATL~ICN | 1673359860 | 1673383440 | 1673417100 | 1673453400 | 6.550000 | 10.083333 |
| ATL~LAS | 1673347500 | 1673398980 | 1673364300 | 1673416680 | 14.300000 | 14.550000 |
| ATL~LAX | 1673350200 | 1673393100 | 1673372700 | 1673420220 | 11.916667 | 13.200000 |
| ... | ... | ... | ... | ... | ... | ... |
| SLC~JFK | 1673339820 | 1673387100 | 1673364420 | 1673411340 | 13.133333 | 13.033333 |
| SLC~LHR | 1673359200 | 1673380500 | 1673407800 | 1673429700 | 5.916667 | 6.083333 |
| SLC~MIA | 1673333820 | 1673387100 | 1673349960 | 1673413080 | 14.800000 | 17.533333 |
| SLC~NRT | 1673359200 | 1673380500 | 1673418900 | 1673449200 | 5.916667 | 8.416667 |
| SLC~ORD | 1673339820 | 1673387100 | 1673351100 | 1673407620 | 13.133333 | 15.700000 |
338 rows × 6 columns