The 3MKT Network

PassengerSim includes a demo network called three market and commonly written as “3MKT”.

import passengersim as pax

pax.versions()
passengersim 0.80
passengersim.core 0.80
cfg = pax.Config.from_yaml(pax.demo_network("3MKT/DEMO"))

This network, as its name suggests, includes a simulation of … three markets, where each market is defined by an origin-destination pair:

  • Boston BOS to Chicago ORD,

  • Chicago ORD to Los Angeles LAX, and

  • Boston BOS to Los Angeles LAX.

Each market has some market demand that consists of potential passengers, who would like to travel from the origin to the destination on a simulated day. That demand is composed of two passenger segments: business and leisure.

from passengersim.config.dataframes import demands_to_dataframe

demands_to_dataframe(cfg.demands)
orig dest segment base_demand reference_price emult distance choice_model dwm_tolerance todd_curve curve group_sizes prob_saturday_night prob_num_days deterministic
0 BOS ORD business 70.0 250.0 None 863.753 business 0.0 None c1 None None [] False
1 BOS ORD leisure 90.0 100.0 None 863.753 leisure 0.0 None c2 None None [] False
2 ORD LAX business 120.0 375.0 None 1739.799 business 0.0 None c1 None None [] False
3 ORD LAX leisure 150.0 150.0 None 1739.799 leisure 0.0 None c2 None None [] False
4 BOS LAX business 100.0 500.0 None 2603.449 business 0.0 None c1 None None [] False
5 BOS LAX leisure 140.0 200.0 None 2603.449 leisure 0.0 None c2 None None [] False
cfg.demands
[Demand(orig='BOS', dest='ORD', segment='business', base_demand=70.0, reference_price=250.0, emult=None, distance=863.753, choice_model='business', dwm_tolerance=0.0, todd_curve=None, curve='c1', group_sizes=None, prob_saturday_night=None, prob_num_days=[], deterministic=False, overrides=[]),
 Demand(orig='BOS', dest='ORD', segment='leisure', base_demand=90.0, reference_price=100.0, emult=None, distance=863.753, choice_model='leisure', dwm_tolerance=0.0, todd_curve=None, curve='c2', group_sizes=None, prob_saturday_night=None, prob_num_days=[], deterministic=False, overrides=[]),
 Demand(orig='ORD', dest='LAX', segment='business', base_demand=120.0, reference_price=375.0, emult=None, distance=1739.799, choice_model='business', dwm_tolerance=0.0, todd_curve=None, curve='c1', group_sizes=None, prob_saturday_night=None, prob_num_days=[], deterministic=False, overrides=[]),
 Demand(orig='ORD', dest='LAX', segment='leisure', base_demand=150.0, reference_price=150.0, emult=None, distance=1739.799, choice_model='leisure', dwm_tolerance=0.0, todd_curve=None, curve='c2', group_sizes=None, prob_saturday_night=None, prob_num_days=[], deterministic=False, overrides=[]),
 Demand(orig='BOS', dest='LAX', segment='business', base_demand=100.0, reference_price=500.0, emult=None, distance=2603.449, choice_model='business', dwm_tolerance=0.0, todd_curve=None, curve='c1', group_sizes=None, prob_saturday_night=None, prob_num_days=[], deterministic=False, overrides=[]),
 Demand(orig='BOS', dest='LAX', segment='leisure', base_demand=140.0, reference_price=200.0, emult=None, distance=2603.449, choice_model='leisure', dwm_tolerance=0.0, todd_curve=None, curve='c2', group_sizes=None, prob_saturday_night=None, prob_num_days=[], deterministic=False, overrides=[])]

Customers from these two segments have quite different purchase preferences, and arrive to book seats (or walk away without a booking) with quite different time distributions.

cfg.fig_booking_curves()

Each of these markets is served by two carriers, who fly identical schedules. Each carrier offers two flights per day from BOS to ORD, and two more from ORD to LAX.

from passengersim.config.dataframes import legs_to_dataframe

legs_to_dataframe(cfg.legs)
leg_id 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
0 101 BOS ORD America/New_York America/Chicago AL1 101 863.753 100 2020-03-01 00:00:00+00:00 1583067600 1583078400 -18000 -21600 8.0 10.0 180
1 102 BOS ORD America/New_York America/Chicago AL1 102 863.753 100 2020-03-01 00:00:00+00:00 1583089200 1583100000 -18000 -21600 14.0 16.0 180
2 201 BOS ORD America/New_York America/Chicago AL2 201 863.753 100 2020-03-01 00:00:00+00:00 1583067600 1583078400 -18000 -21600 8.0 10.0 180
3 202 BOS ORD America/New_York America/Chicago AL2 202 863.753 100 2020-03-01 00:00:00+00:00 1583089200 1583100000 -18000 -21600 14.0 16.0 180
4 111 ORD LAX America/Chicago America/Los_Angeles AL1 111 1739.799 120 2020-03-01 00:00:00+00:00 1583082000 1583096400 -21600 -28800 11.0 13.0 240
5 112 ORD LAX America/Chicago America/Los_Angeles AL1 112 1739.799 120 2020-03-01 00:00:00+00:00 1583103600 1583118000 -21600 -28800 17.0 19.0 240
6 211 ORD LAX America/Chicago America/Los_Angeles AL2 211 1739.799 120 2020-03-01 00:00:00+00:00 1583082000 1583096400 -21600 -28800 11.0 13.0 240
7 212 ORD LAX America/Chicago America/Los_Angeles AL2 212 1739.799 120 2020-03-01 00:00:00+00:00 1583103600 1583118000 -21600 -28800 17.0 19.0 240
cfg.fig_route_map()

Each carrier offers six fare classes in each market, labeled as “Y0” through “Y5”. The prices and restrictions imposed are consistent across the carriers within each market.

from passengersim.config.dataframes import fares_to_dataframe

fares_to_dataframe(cfg.fares)
carrier orig dest booking_class price advance_purchase restrictions category cabin min_stay saturday_night_required
0 AL1 BOS ORD Y0 400.0 0 None Y 0 False
1 AL1 BOS ORD Y1 300.0 0 R2 None Y 0 False
2 AL1 BOS ORD Y2 200.0 3 R1 None Y 0 False
3 AL1 BOS ORD Y3 150.0 7 R1|R2 None Y 0 False
4 AL1 BOS ORD Y4 125.0 14 R1|R3 None Y 0 False
5 AL1 BOS ORD Y5 100.0 21 R1|R2|R3 None Y 0 False
6 AL1 ORD LAX Y0 500.0 0 None Y 0 False
7 AL1 ORD LAX Y1 400.0 0 R2 None Y 0 False
8 AL1 ORD LAX Y2 300.0 3 R1 None Y 0 False
9 AL1 ORD LAX Y3 225.0 7 R1|R2 None Y 0 False
10 AL1 ORD LAX Y4 175.0 14 R1|R3 None Y 0 False
11 AL1 ORD LAX Y5 150.0 21 R1|R2|R3 None Y 0 False
12 AL1 BOS LAX Y0 750.0 0 None Y 0 False
13 AL1 BOS LAX Y1 625.0 0 R2 None Y 0 False
14 AL1 BOS LAX Y2 450.0 3 R1 None Y 0 False
15 AL1 BOS LAX Y3 325.0 7 R1|R2 None Y 0 False
16 AL1 BOS LAX Y4 250.0 14 R1|R3 None Y 0 False
17 AL1 BOS LAX Y5 200.0 21 R1|R2|R3 None Y 0 False
18 AL2 BOS ORD Y0 400.0 0 None Y 0 False
19 AL2 BOS ORD Y1 300.0 0 R2 None Y 0 False
20 AL2 BOS ORD Y2 200.0 3 R1 None Y 0 False
21 AL2 BOS ORD Y3 150.0 7 R1|R2 None Y 0 False
22 AL2 BOS ORD Y4 125.0 14 R1|R3 None Y 0 False
23 AL2 BOS ORD Y5 100.0 21 R1|R2|R3 None Y 0 False
24 AL2 ORD LAX Y0 500.0 0 None Y 0 False
25 AL2 ORD LAX Y1 400.0 0 R2 None Y 0 False
26 AL2 ORD LAX Y2 300.0 3 R1 None Y 0 False
27 AL2 ORD LAX Y3 225.0 7 R1|R2 None Y 0 False
28 AL2 ORD LAX Y4 175.0 14 R1|R3 None Y 0 False
29 AL2 ORD LAX Y5 150.0 21 R1|R2|R3 None Y 0 False
30 AL2 BOS LAX Y0 750.0 0 None Y 0 False
31 AL2 BOS LAX Y1 625.0 0 R2 None Y 0 False
32 AL2 BOS LAX Y2 450.0 3 R1 None Y 0 False
33 AL2 BOS LAX Y3 325.0 7 R1|R2 None Y 0 False
34 AL2 BOS LAX Y4 250.0 14 R1|R3 None Y 0 False
35 AL2 BOS LAX Y5 200.0 21 R1|R2|R3 None Y 0 False