Carrier
Carrier objects, mostly has counters and link to RM pipeline.
ancillaries
instance-attribute
List of ancillaries that this airline will offer.
This attribute is read-only.
brand_preference
instance-attribute
An array of Brand Preference information.
control
instance-attribute
RM control technique, such as 'leg', 'bp', 'bp_loose', 'vn', 'cabin', 'theft', or 'none'.
This attribute is read-only.
cp_algorithm
instance-attribute
Algorithm to use for Continuous Pricing, defaults to 'None'.
cp_elasticity
instance-attribute
For Continuous Pricing, estimate customer price elasticity.
cp_quantize
instance-attribute
For Continuous Pricing, round the value to this.
i.e. 10 will result in all prices being a multiple of 10.
cp_record
instance-attribute
For Continuous Pricing, do we record in the highest_closed class or the lowest_open?
cp_record_highest_closed_as_open
instance-attribute
For Continuous Pricing, do we record the highest closed class as open in the pathclass history?
Has no effect unless cp_record is set to highest_closed.
cp_scale
instance-attribute
Scale the Continuous Pricing modifier.
Example, 0.5 will add 50% of the modifier to the bid price.
dcp_days_prior
instance-attribute
Days prior for DCPs (i.e. the start time of each timeframe).
This attribute is read-only.
gt_available_seat_miles
instance-attribute
Grand total ASM.
This value is updated outside the burn period and is not reset by the reset methods.
gt_cp_revenue
instance-attribute
Grand total Continuous Pricing revenue.
This value is updated outside the burn period and is not reset by the reset methods.
gt_cp_sold
instance-attribute
Grand total Continuous Pricing sales.
This value is updated outside the burn period and is not reset by the reset methods.
gt_demand
instance-attribute
Grand total generated demand.
This value is updated outside the burn period and is not reset by the reset methods.
gt_revenue
instance-attribute
Grand total revenue.
This value is updated outside the burn period and is not reset by the reset methods.
gt_revenue_passenger_miles
instance-attribute
Grand total RPM.
This value is updated outside the burn period and is not reset by the reset methods.
gt_sold
instance-attribute
Grand total sold.
This value is updated outside the burn period and is not reset by the reset methods.
load_factor_curve
instance-attribute
Load Factor curve, was an experiment in used this type of RM control. (deprecated)
name
instance-attribute
Name is usually the code, such as 'AL1' or 'DL'.
This attribute is read-only.
num_objects
instance-attribute
Number of Carrier objects allocated, was used for memory leak detection.
This attribute is read-only.
proration_rule
instance-attribute
How do we prorate revenue between legs on connecting paths?
rm_system
instance-attribute
An instance of RmSystem, called at each DCP to do detruncation forecasting / optimization.
sold_priceable
instance-attribute
Number sold priceable, reset after each sample.
truncation_rule
instance-attribute
Do we mark a TimeFrame as closed if it's closed at the start, end, or both.
Values: 1=beginning, 2=end, 3=beginning_or_end
__init__
__init__(
name: str,
control: Literal[
"leg",
"cabin",
"theft",
"bp",
"bp_loose",
"vn",
"none",
] = "leg",
) -> None
Initialize a new Carrier.
Parameters:
-
name(str) –Name of the carrier, usually the code such as 'AL1' or 'DL'.
-
control(('leg', 'cabin', 'theft', 'bp', 'bp_loose', 'vn', 'none'), default:"leg") –RM control technique to use.
add_ancillary
Add an ancillary (code & price).
Parameters:
-
anc(Ancillary) –The ancillary item to add.
Returns:
-
int–Returns 0 on success.
add_carrier_history
add_carrier_history(
trial: int,
sample: int,
sold: int,
sold_priceable: int,
revenue: float,
) -> int
Add an item to the carrier history.
ONLY USED FOR UNIT TESTING.
Parameters:
-
trial(int) –Trial number.
-
sample(int) –Sample number.
-
sold(int) –Number of items sold.
-
sold_priceable(int) –Number of priceable items sold.
-
revenue(float) –Revenue amount.
Returns:
-
int–Returns 0 on success.
add_frat5_mkt
Specify Frat5 for an O&D market.
Parameters:
-
orig(str) –Origin airport code.
-
dest(str) –Destination airport code.
-
frat5(Frat5) –The Frat5 curve to use for this market.
get_ancillary_by_index
Get ancillary by index.
ONLY USED FOR DEBUGGING.
Parameters:
-
index(int) –The index of the ancillary to retrieve.
Returns:
-
Ancillary–The ancillary at the specified index.
get_ancillary_price
Get the price for an ancillary, by code.
Parameters:
-
name(str) –The ancillary code to look up.
Returns:
-
float–The price of the ancillary.
get_ancillary_sold
Get the sold for an ancillary, by code.
Parameters:
-
name(str) –The ancillary code to look up.
Returns:
-
int–The number sold of the ancillary.
get_carrier_history
Return carrier history, has an item for each sample.
Returns:
-
list–List of dictionaries, each containing carrier history data for a sample.
get_forecast_accuracy
Return forecast accuracy, as a dictionary.
Returns:
-
list–List of dictionaries containing forecast accuracy data.
get_frat5_mkt
Get Frat5 for an O&D market.
Parameters:
-
orig(str) –Origin airport code.
-
dest(str) –Destination airport code.
Returns:
-
Frat5 or None–The Frat5 curve for the specified market, or None if not found.
get_history_def
Get the history definition, used to initialize the history for this carrier's buckets and pathclasses.
Returns:
-
dict–Dictionary with history definition data including 'num_departures', 'num_timeframes', and 'store_priceable'.
raw_bid_price_trace
Raw bid price trace.
Returns:
-
dict–Dictionary with DCP keys and values containing bid price statistics.
raw_bookings_by_day
Raw bookings by fare class by days prior.
Returns:
-
dict–Dictionary with fare class keys and values containing day-prior bookings.
raw_bookings_by_segment_fare_dcp
Raw bookings by segment, fare class, and dcp.
Returns:
-
dict–Dictionary containing booking data by segment, fare class and DCP.
raw_displacement_cost_trace
Raw displacement cost trace.
Returns:
-
dict–Dictionary with DCP keys and values containing displacement cost statistics.
raw_fare_class_distribution
Raw fare class distribution.
Returns:
-
dict–Dictionary with fare class keys and values containing 'sold' and 'revenue' keys.
raw_load_factor_distribution
Raw load factor distribution.
Returns:
-
ndarray–Array of load factor distribution data.
raw_revenue_by_segment_fare_dcp
Raw revenue by segment, fare class, and dcp.
Returns:
-
dict–Dictionary containing revenue data by segment, fare class and DCP.