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")
/Users/jpn/Git/pax-v0.95/.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-07 00:00:00+00:00 1673111100 1673121960 -25200 -18000 10.083333 15.100000 181
15 DEN ATL America/Denver America/New_York Bison 15 1199.0 150 2023-01-07 00:00:00+00:00 1673124060 1673134620 -25200 -18000 13.683333 18.616667 176
22 DEN ATL America/Denver America/New_York Bison 22 1199.0 150 2023-01-07 00:00:00+00:00 1673138460 1673149020 -25200 -18000 17.683333 22.616667 176
87 ATL DEN America/New_York America/Denver Bison 87 1199.0 150 2023-01-07 00:00:00+00:00 1673100660 1673113440 -18000 -25200 9.183333 10.733333 213
88 ATL DEN America/New_York America/Denver Bison 88 1199.0 150 2023-01-07 00:00:00+00:00 1673126700 1673139780 -18000 -25200 16.416667 18.050000 218
... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ... ...
354 SLC ORD America/Denver America/Chicago Eagle 354 1249.0 166 2023-01-07 00:00:00+00:00 1673106000 1673117400 -25200 -21600 8.666667 12.833333 190
355 SLC ORD America/Denver America/Chicago Eagle 355 1249.0 179 2023-01-07 00:00:00+00:00 1673121300 1673132700 -25200 -21600 12.916667 17.083333 190
417 ORD SLC America/Chicago America/Denver Eagle 417 1249.0 179 2023-01-07 00:00:00+00:00 1673103600 1673117220 -21600 -25200 9.000000 11.783333 227
426 ORD SLC America/Chicago America/Denver Eagle 426 1249.0 150 2023-01-07 00:00:00+00:00 1673128800 1673141880 -21600 -25200 16.000000 18.633333 218
441 ORD SLC America/Chicago America/Denver Eagle 441 1249.0 166 2023-01-07 00:00:00+00:00 1673144280 1673157600 -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 1673100660 1673124240 1673148600 1673170800 6.550000 6.166667
ATL~DEN 1673091000 1673126700 1673112900 1673153880 9.916667 11.383333
ATL~ICN 1673100660 1673124240 1673157900 1673194200 6.550000 10.083333
ATL~LAS 1673088300 1673139780 1673105100 1673157480 14.300000 14.550000
ATL~LAX 1673091000 1673133900 1673113500 1673161020 11.916667 13.200000
... ... ... ... ... ... ...
SLC~JFK 1673080620 1673127900 1673105220 1673152140 13.133333 13.033333
SLC~LHR 1673100000 1673121300 1673148600 1673170500 5.916667 6.083333
SLC~MIA 1673080620 1736233020 1673110020 1736249160 17542.333333 17538.650000
SLC~NRT 1673100000 1673121300 1673159700 1673190000 5.916667 8.416667
SLC~ORD 1673080620 1673127900 1673091900 1673148420 13.133333 15.700000

338 rows × 6 columns