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).
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 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 the booking curve as a dictionary.
Returns:
-
dict[int, float]–Dictionary mapping days prior to departure (DCP) to cumulative booking percentages.