Skip to content

Path

adjusted_at instance-attribute

adjusted_at: int

dest instance-attribute

dest: str

fcst_mean instance-attribute

fcst_mean: float

fcst_mean_next_tf instance-attribute

fcst_mean_next_tf: float

fcst_std_dev instance-attribute

fcst_std_dev: float

fcst_std_dev_next_tf instance-attribute

fcst_std_dev_next_tf: float

gt_revenue instance-attribute

gt_revenue: float

gt_sold instance-attribute

gt_sold: int

gt_sold_priceable instance-attribute

gt_sold_priceable: int

last_fcst_ts instance-attribute

last_fcst_ts: int

orig instance-attribute

orig: str

path_quality_index instance-attribute

path_quality_index: float

pathclasses instance-attribute

pathclasses: Iterator[PathClass]

price instance-attribute

price: float

raw_fcst_mean instance-attribute

raw_fcst_mean: float

raw_fcst_std_dev instance-attribute

raw_fcst_std_dev: float

revenue instance-attribute

revenue: float

sold instance-attribute

sold: int

sold_priceable instance-attribute

sold_priceable: int

utility instance-attribute

utility: float

__init__

__init__(orig: str, dest: str, price: float)

accumulate_forecasts

accumulate_forecasts()

Adds the path fcst to each leg / bucket

accumulate_forecasts_vn

accumulate_forecasts_vn()

Adds the path fcst to each leg / bucket, using the Virtual Nesting mapping

add_airline

add_airline(airline: Airline) -> None

Add an Airline to this Path.

add_booking_class

add_booking_class(booking_class: str)

Add a booking class to this Path

add_leg

add_leg(leg: Leg) -> None

Add a leg to this Path.

add_path_class

add_path_class(path_class: PathClass)

Add a path class to this Path

adjust_forecasts

adjust_forecasts(
    algorithm: str,
    last_ts: int,
    current_ts: int,
    end_tf_ts: int,
    departure_ts: int,
    snapshot_instruction: "SnapshotInstruction | None" = None,
) -> None

Adjust the forecast for this path and any path-class items it has, using in daily reoptimization

allocate_q_demand

allocate_q_demand(
    frat5: Frat5, dcp_index: int, debug: bool
) -> float

First step in Q-forecasting

capture_dcp

capture_dcp(dcp_index: int)

Save relevant information for this DCP

check_avail

check_avail(
    fare: "Fare", num_pax: int, debug: Optional[bool]
)

Is this fare available on the Path? Used for unit testing

compute_q_equivalent

compute_q_equivalent(
    frat5: Frat5,
    dcp_index: int,
    max_cap: float = 10.0,
    snapshot_instruction: "SnapshotInstruction | None" = None,
) -> float

First step in Q-forecasting

forecast

forecast(
    dcp_index: int,
    algorithm: str,
    event_time: int,
    snapshot_instruction: "SnapshotInstruction | None" = None,
) -> float

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

get_class_decision_fare

get_class_decision_fare(pc_index: int | str) -> float

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

get_class_fcst_mean

get_class_fcst_mean(pc_index: int | str) -> float

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

get_class_sold

get_class_sold(pc_index: int | str) -> int

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

get_class_std_dev

get_class_std_dev(pc_index: int | str) -> float

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

get_leg_bid_price

get_leg_bid_price(n: int) -> float

Get the bid price on the n-th leg.

get_leg_carrier

get_leg_carrier(n: int) -> str

Get the carrier code for the n-th leg.

get_leg_dep_time

get_leg_dep_time(n: int) -> int

Get the departure timestamp code for the n-th leg.

get_leg_dest

get_leg_dest(n: int) -> str

Get the destination airport for the n-th leg.

get_leg_equipment

get_leg_equipment(n: int) -> str

Get the equipment code for the n-th leg.

get_leg_fltno

get_leg_fltno(n: int) -> int

Get the flight number for the n-th leg.

get_leg_orig

get_leg_orig(n: int) -> str

Get the origin airport for the n-th leg.

get_total_bid_price

get_total_bid_price() -> float

Get the total of bid prices on all legs

get_total_distance

get_total_distance() -> float

Get the total of distances on all legs

hybrid_forecast

hybrid_forecast(
    dcp_index: int,
    algorithm: str,
    snapshot_instruction: "SnapshotInstruction | None",
    frat5: Frat5,
    max_cap: float = 10,
) -> float

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

num_classes

num_classes() -> int

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

num_deps

num_deps() -> int

How many historical departures are on this path?

num_legs

num_legs() -> int

How many legs are on this path?

print_class_history

print_class_history(path_class_index: int) -> str

Print some historical data to stdout, mostly for debugging

set_class_decision_fare

set_class_decision_fare(pc_index: int | str, fcst: float)

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

set_class_fcst_mean

set_class_fcst_mean(pc_index: int | str, fcst: float)

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

set_class_sold

set_class_sold(pc_index: int | str, sold: int)

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

set_class_std_dev

set_class_std_dev(pc_index: int | str, fcst: float)

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

untruncate_demand

untruncate_demand(
    dcp_index: int,
    algorithm: str,
    debug: "SnapshotInstruction | None" = None,
)

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