BookingCurve¶
- class passengersim.core.BookingCurve¶
Bases:
objectBooking 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).
Methods
__init__(*args, **kwargs)Add a days-prior-to-departure (DCP) point to the booking curve.
Get the booking curve as a dictionary.
Verify that the booking curve percentages are monotonically increasing.
Attributes
Name of the booking curve.
Random number generator used for sampling from the booking curve.
- 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.
- name¶
Name of the booking curve.
- Returns:
str – The booking curve name.
- random_generator¶
Random number generator used for sampling from the booking curve.
- Returns:
Generator – The random number generator instance.
- verify_curve()¶
Verify that the booking curve percentages are monotonically increasing.
- Returns:
bool – True if the curve percentages are valid (monotonically increasing), False otherwise.