Skip to content

Leg

arr_time instance-attribute

arr_time: int

bid_price instance-attribute

bid_price: float

bid_price_gradient instance-attribute

bid_price_gradient: float

buckets instance-attribute

buckets: Iterator[Bucket]

capacity instance-attribute

capacity: int

carrier instance-attribute

carrier: str

dep_time instance-attribute

dep_time: int

dest instance-attribute

dest: str

displacement instance-attribute

displacement: float

distance instance-attribute

distance: float

duration instance-attribute

duration: float

equipment instance-attribute

equipment: 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

flt_no instance-attribute

flt_no: int

gt_capacity instance-attribute

gt_capacity: int

gt_revenue instance-attribute

gt_revenue: float

gt_sold instance-attribute

gt_sold: int

info instance-attribute

info: Any

orig instance-attribute

orig: str

q_demand instance-attribute

q_demand: float

revenue instance-attribute

revenue: float

sold instance-attribute

sold: float

__init__

__init__(
    carrier: str,
    flt_no: int,
    orig: str,
    dest: str,
    capacity: int = 0,
    sold: int = 0,
    duration: int = 0,
    equipment: str = None,
    info: Any = None,
)

add_bucket

add_bucket(*args: Bucket)

Add an inventory control bucket to the Leg.

bucket_number

bucket_number(i: int | str) -> Bucket

Get the bucket from the leg.

Parameters:

  • i (int or str) –

    If an integer, returns the bucket at this index position from the list of buckets attached to this Leg. If given as a str, returns the bucket with the indicated booking class.

Returns:

capture_dcp

capture_dcp(i: int) -> None

Grab a snapshot of important variables.

Parameters:

  • i (int) –

    The index of the DCP to capture.

forecast

forecast(
    dcp_index: int,
    algorithm: str,
    snapshot_instruction: "SnapshotInstruction | None" = None,
)

get_bucket_auth

get_bucket_auth(i: int | str) -> int

Get the authorization for a bucket attached to this leg.

Parameters:

  • i (int or str) –

    If an integer, returns the auth of the bucket at this index position from the list of buckets attached to this Leg. If given as a str, returns the auth of the bucket with the indicated booking class.

Returns:

  • int

get_bucket_decision_fare

get_bucket_decision_fare(bkt_ref: int | str) -> float

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

get_bucket_fcst_mean

get_bucket_fcst_mean(bkt_ref: int | str) -> float

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

get_bucket_fcst_revenue

get_bucket_fcst_revenue(bkt_ref: int | str) -> float

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

get_bucket_fcst_std_dev

get_bucket_fcst_std_dev(bkt_ref: int | str) -> float

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

get_bucket_revenue

get_bucket_revenue(bkt_ref: int | str) -> float

Get the revenue for a bucket, either by class name (string) or index (int)

get_bucket_sold

get_bucket_sold(i: int | str) -> int

Get the number of seats sold for a bucket attached to this leg.

Parameters:

  • i (int or str) –

    If an integer, returns the number of seats sold for the bucket at this index position from the list of buckets attached to this Leg. If given as a str, returns the number of seats sold for the bucket with the indicated booking class.

Returns:

  • int

get_num_buckets

get_num_buckets() -> int

Get the number of buckets attached to this leg.

littlewood

littlewood(
    mu: float,
    sigma: float,
    rev_hi: float,
    rev_lo: float,
    cv100: float,
) -> float

print_bucket_detail

print_bucket_detail()

Print a bunch of debugging info

print_bucket_history

print_bucket_history()

Print a bunch of debugging info

set_bucket_auth

set_bucket_auth(bkt_ref: int | str, auth: int)

Set the authorization for a bucket, either by class name (string) or index (int)

set_bucket_decision_fare

set_bucket_decision_fare(bkt_ref: int | str, auth: int)

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

set_bucket_fcst_mean

set_bucket_fcst_mean(bkt_ref: int | str, auth: int)

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

set_bucket_fcst_revenue

set_bucket_fcst_revenue(bkt_ref: int | str, auth: int)

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

set_bucket_fcst_std_dev

set_bucket_fcst_std_dev(bkt_ref: int | str, auth: int)

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

set_bucket_revenue

set_bucket_revenue(bkt_ref: int | str, auth: int)

Set the revenue for a bucket, either by class name (string) or index (int)

set_bucket_sold

set_bucket_sold(bkt_ref: int | str, sold: int)

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

untruncate_demand

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

Run the demand untruncation models for this leg and its buckets.

write_to_sqlite

write_to_sqlite(
    sqlite_pointer: sqlite3.Connection,
    sim: SimulationEngine,
    dcp: int,
)

Write to leg_bucket_detail.