Path

class passengersim.core.Path

Bases: object

Path objects

Methods

__init__(*args, **kwargs)

accumulate_forecasts

Adds the path fcst to each leg

add_booking_class

Add a booking class to this Path

add_carrier

Add a carrier to this Path - used for unit testing !!!

add_leg

Add a leg to this Path

add_order

Add an Order to this Path, mostly for unit testing

add_path_class

Add a path class to this Path

allocate_q_demand

Allocate Q-equivalent demand back to PathClass level, using a Frat5 curve

capture_dcp

Save relevant information for this DCP

check_avail

Check if the Fare is available on the Path, mostly used for unit testing

combine_forecasts

Combine the Y and Q forecasts for this path

compute_classless_q_equivalent_history

Compute Q-equivalent demand, based on classless orders, using a Frat5 curve

compute_conditional_q_forecast

Compute the conditional Q forecast for this path

compute_fare_adjustments

Run the fare adjustment models for this path and any path-class items it has

compute_forecasts

Run the forecast models for this path and any path-class items it has

compute_hybrid_forecasts(dcp_index, ...)

compute_q_equivalent

Compute Q-equivalent demand, using a Frat5 curve

compute_simple_fare_adjustments

Run simple fare adjustment models for this path's path-class items.

contains_leg_id

Check if this path contains a particular leg_id.

detruncate_demand

Run the demand untruncation models for this path and any path-class items it has

get_class_decision_fare

Get the decision fare for a class, either by class name (string) or index (int)

get_class_fcst_mean

Get the demand forecast for a class, either by class name (string) or index (int)

get_class_fcst_std_dev

Get the demand forecast std dev for a class, either by class name (string) or index (int)

get_class_sold

Get the number sold for a class, either by class name (string) or index (int)

get_displacement_adjusted_fare

Adjust the fare for displacement, with optional normalization

get_f_star

Get the classless CP F* value for the specified timeframe

get_forecast_data

Get forecast data

get_leg_arr_time

Get the departure timestamp for the n-th leg

get_leg_arr_time_local

Get the arrival timestamp for the n-th leg, adjusted for TZ

get_leg_bid_price

Get the bid price on the n-th leg

get_leg_capacity

Get the capacity for the n-th leg

get_leg_carrier

Get the carrier code for the n-th leg

get_leg_dep_time

Get the departure timestamp for the n-th leg

get_leg_dep_time_local

Get the departure timestamp for the n-th leg, adjusted for TZ

get_leg_dest

Get the destination airport for the n-th leg

get_leg_equipment

Get the equipment code for the n-th leg

get_leg_fltno

Get the flight number for the n-th leg

get_leg_id

Get the flight number for the n-th leg

get_leg_orig

Get the origin airport for the n-th leg

get_orders

Return orders as a list of dictionaries, optional 'offset' parameter is how many samples to go back in history

get_total_bid_price

Get the total of bid price on all legs

get_total_distance

Get the total of distance on all legs

mid_timeframe_forecast_interpolation

Adjust the forecasts (mean and std_dev) for daily reoptimization

new_forecast

Get a ForecastGroup object that follows this Path

next_departure

Roll forward history buffers

num_classes

Return the number of booking classes that are tracked for this Path

num_deps

How many departures are on this path?

num_legs

How many legs are on this path?

report_total_bid_price

Get the total of reportable bid price on all legs

reset_counters

Reset counters

set_class_decision_fare

Set the decision fare for a class, either by class name (string) or index (int)

set_class_fcst_mean

Set the demand forecast for a class, either by class name (string) or index (int)

set_class_fcst_std_dev

Set the demand forecast std dev for a class, either by class name (string) or index (int)

set_class_sold

Set the number sold for a class, either by class name (string) or index (int)

update_forecasts

Update forecast cache values

Attributes

arr_time

Arrival time of last leg

carrier

Carrier for this Path

carrier_name

Carrier code for this Path

delta_t

DeltaT, in minutes (fo DWM)

dep_time

Departure time of first leg

dest

Destination Airport code

duration

Duration, in minutes

early_path

forecast

Accessor to the forecasts for this path, exposing ForecastGroup API

gt_revenue

Grand Total revenue, excludes burn samples

gt_sold

Grand Total sold, excludes burn samples

gt_sold_priceable

Grand Total sold priceable, excludes burn samples

hhi

Herfindahl–Hirschman index

late_path

leg_ids

legs

Access the legs for this path

market

The Market that this Path applies to

max_hhi

minimum_connect_time

num_objects

Number of Path objects allocated, was used to detect memory leaks

orig

Origin Airport code

path_id

Unique ID for this Path.Can be input by the caller, or is created by the conection generator

path_quality_index

Numeric value, used in the ChoiceModel

pathclasses

Iterator for the PathClass objects on this Path

price

Default price (deprecated)

q_forecast

revenue

Total revenue, is reset at the end of the sample

sold

Number sold, is reset at the end of the sample

sold_priceable

Number sold priceable, is reset at the end of the sample

total_bid_price

truncation_rule

Do we mark as closed if closed at start of TF, end of TF, or both?

accumulate_forecasts()

Adds the path fcst to each leg

add_booking_class()

Add a booking class to this Path

add_carrier()

Add a carrier to this Path - used for unit testing !!!

add_leg()

Add a leg to this Path

add_order()

Add an Order to this Path, mostly for unit testing

add_path_class()

Add a path class to this Path

allocate_q_demand()

Allocate Q-equivalent demand back to PathClass level, using a Frat5 curve

arr_time

Arrival time of last leg

capture_dcp()

Save relevant information for this DCP

carrier

Carrier for this Path

carrier_name

Carrier code for this Path

check_avail()

Check if the Fare is available on the Path, mostly used for unit testing

combine_forecasts()

Combine the Y and Q forecasts for this path

compute_classless_q_equivalent_history()

Compute Q-equivalent demand, based on classless orders, using a Frat5 curve

compute_conditional_q_forecast()

Compute the conditional Q forecast for this path

compute_fare_adjustments()

Run the fare adjustment models for this path and any path-class items it has

compute_forecasts()

Run the forecast models for this path and any path-class items it has

compute_hybrid_forecasts(dcp_index, algorithm, frat5, ...)

Run the hybrid forecast models for this path and its path-class items.

Parameters:
dcp_index : int

Only compute forecasts only from this DCP to departure.

algorithm : {'exp_smoothing', 'additive_pickup'}

Forecasting algorithm to use.

frat5 : Frat5

Frat5 object to use for Q-forecasting.

snapshot_instruction : SnapshotInstruction, optional

If not None, a snapshot of the forecast will be written based on these instructions.

recompute : bool, default True

If True, recompute the entire forecast. Otherwise, the forecast cached values will be moved to a new dcp_index.

max_cap : float, default 10.0

Maximum capacity inflation for Q-forecasting.

pods_init : bool

alpha : float, default 0.15

Smoothing factor for exponential smoothing. This is a keyword-only argument.

compute_q_equivalent()

Compute Q-equivalent demand, using a Frat5 curve

compute_simple_fare_adjustments()

Run simple fare adjustment models for this path’s path-class items.

contains_leg_id()

Check if this path contains a particular leg_id.

delta_t

DeltaT, in minutes (fo DWM)

dep_time

Departure time of first leg

dest

Destination Airport code

detruncate_demand()

Run the demand untruncation models for this path and any path-class items it has

duration

Duration, in minutes

early_path
forecast

Accessor to the forecasts for this path, exposing ForecastGroup API

get_class_decision_fare()

Get the decision fare for a class, either by class name (string) or index (int)

get_class_fcst_mean()

Get the demand forecast for a class, either by class name (string) or index (int)

get_class_fcst_std_dev()

Get the demand forecast std dev for a class, either by class name (string) or index (int)

get_class_sold()

Get the number sold for a class, either by class name (string) or index (int)

get_displacement_adjusted_fare()

Adjust the fare for displacement, with optional normalization

get_f_star()

Get the classless CP F* value for the specified timeframe

get_forecast_data()

Get forecast data

get_leg_arr_time()

Get the departure timestamp for the n-th leg

get_leg_arr_time_local()

Get the arrival timestamp for the n-th leg, adjusted for TZ

get_leg_bid_price()

Get the bid price on the n-th leg

get_leg_capacity()

Get the capacity for the n-th leg

get_leg_carrier()

Get the carrier code for the n-th leg

get_leg_dep_time()

Get the departure timestamp for the n-th leg

get_leg_dep_time_local()

Get the departure timestamp for the n-th leg, adjusted for TZ

get_leg_dest()

Get the destination airport for the n-th leg

get_leg_equipment()

Get the equipment code for the n-th leg

get_leg_fltno()

Get the flight number for the n-th leg

get_leg_id()

Get the flight number for the n-th leg

get_leg_orig()

Get the origin airport for the n-th leg

get_orders()

Return orders as a list of dictionaries, optional ‘offset’ parameter is how many samples to go back in history

get_total_bid_price()

Get the total of bid price on all legs

get_total_distance()

Get the total of distance on all legs

gt_revenue

Grand Total revenue, excludes burn samples

gt_sold

Grand Total sold, excludes burn samples

gt_sold_priceable

Grand Total sold priceable, excludes burn samples

hhi

Herfindahl–Hirschman index

late_path
leg_ids
legs

Access the legs for this path

market

The Market that this Path applies to

max_hhi
mid_timeframe_forecast_interpolation()

Adjust the forecasts (mean and std_dev) for daily reoptimization

minimum_connect_time
new_forecast()

Get a ForecastGroup object that follows this Path

next_departure()

Roll forward history buffers

num_classes()

Return the number of booking classes that are tracked for this Path

num_deps()

How many departures are on this path?

num_legs()

How many legs are on this path?

num_objects

Number of Path objects allocated, was used to detect memory leaks

orig

Origin Airport code

path_id

Unique ID for this Path.Can be input by the caller, or is created by the conection generator

path_quality_index

Numeric value, used in the ChoiceModel

pathclasses

Iterator for the PathClass objects on this Path

price

Default price (deprecated)

q_forecast
report_total_bid_price()

Get the total of reportable bid price on all legs

reset_counters()

Reset counters

revenue

Total revenue, is reset at the end of the sample

set_class_decision_fare()

Set the decision fare for a class, either by class name (string) or index (int)

set_class_fcst_mean()

Set the demand forecast for a class, either by class name (string) or index (int)

set_class_fcst_std_dev()

Set the demand forecast std dev for a class, either by class name (string) or index (int)

set_class_sold()

Set the number sold for a class, either by class name (string) or index (int)

sold

Number sold, is reset at the end of the sample

sold_priceable

Number sold priceable, is reset at the end of the sample

total_bid_price
truncation_rule

Do we mark as closed if closed at start of TF, end of TF, or both?

update_forecasts()

Update forecast cache values