Skip to content

Booking Curves

Booking curve for modeling time-based passenger booking patterns.

A booking curve represents the cumulative distribution function (CDF) of passenger bookings over time, specified as days prior to departure (DCP).

name instance-attribute

name: str

Name of the booking curve.

random_generator instance-attribute

random_generator: Generator

Random number generator used for sampling from the booking curve.

__init__

__init__(
    name: str, /, random_generator: Generator | None = None
)

Initialize a BookingCurve object.

Parameters:

  • name (str) –

    Name identifier for the booking curve.

  • random_generator (Generator or None, default: None ) –

    Random number generator for sampling. If None, a default generator will be used. Default is None.

add_dcp

add_dcp(days_prior: int, pct: float)

Add a days-prior-to-departure (DCP) point to the booking curve.

Parameters:

  • days_prior (int) –

    Number of days prior to departure.

  • pct (float) –

    Cumulative percentage of bookings expected by this DCP.

get_curve

get_curve() -> dict[int, float]

Get the booking curve as a dictionary.

Returns:

  • dict[int, float]

    Dictionary mapping days prior to departure (DCP) to cumulative booking percentages.

verify_curve

verify_curve() -> bool

Verify that the booking curve percentages are monotonically increasing.

Returns:

  • bool

    True if the curve percentages are valid (monotonically increasing), False otherwise.