Demand¶
- class passengersim.config.Demand[source]¶
Bases:
BaseModelSpecification of passenger demand between an origin–destination pair.
A
Demandrecord captures all parameters that govern how many customers arrive in a market, how their willingness-to-pay is modeled, and which simulation primitives (booking curves, choice models, TODD curves, etc.) are attached to those customers.Attributes:
Origin location for this demand.
Destination location for this demand.
Customer segment that this demand belongs to.
Unique identifier for this demand.
Unique identifier for the market of this demand.
Mean number of customers arriving in this market per sample.
Reference price used for willingness-to-pay and choice model scaling.
An 'emult' value for this demand.
O-D distance.
The name of the choice model that is applied for this demand.
The Decision Window is the shortest elapsed time, plus the tolerance (random draw).
Time Of Day curve to be used in the choice model.
The name of the booking curve that is applied for this demand.
Probability of each group size.
Probability that the customer has a R/T itinerary with a Saturday night stay.
Probability of durations.
Whether the total amount of demand generated in each sample should be constant.
Used for some specialized tests.
Effective choice model name, falling back to segment name if not set.
- orig : str¶
Origin location for this demand.
This is commonly a three letter airport code, but it need not be limited to airports. It can be any location that is relevant to the simulation.
If using ‘places’ for locations, this should match the ‘name’ field of a Place object.
- dest : str¶
Destination location for this demand.
This is commonly a three letter airport code, but it need not be limited to airports. It can be any location that is relevant to the simulation.
If using ‘places’ for locations, this should match the ‘name’ field of a Place object.
- segment : str¶
Customer segment that this demand belongs to.
For many applications, segments include ‘business’ and ‘leisure’, but they are not limited to these two categories.
- property identifier : str¶
Unique identifier for this demand.
The identifier encodes the origin, destination, and segment in a single string of the form
"ORIG~DEST@SEGMENT".- Returns:
str – Identifier string in the format
"<orig>~<dest>@<segment>".
- property market_identifier : str¶
Unique identifier for the market of this demand.
The market identifier encodes only the origin and destination, omitting the segment, in a string of the form
"ORIG~DEST".- Returns:
str – Identifier string in the format
"<orig>~<dest>".
- base_demand : float¶
Mean number of customers arriving in this market per sample.
- reference_price : float¶
Reference price used for willingness-to-pay and choice model scaling.
This field was previously named
reference_fare; that name is still accepted as input for backward compatibility but is deprecated and will emit aDeprecationWarning.
- emult : float | None¶
An ‘emult’ value for this demand.
This value scales the decay rate of maximum willingness to pay above the reference price. If not provided, the emult attached to the choice model will be used.
- distance : float | None¶
O-D distance.
- choice_model : str | None¶
The name of the choice model that is applied for this demand.
- dwm_tolerance : float | None¶
The Decision Window is the shortest elapsed time, plus the tolerance (random draw).
- todd_curve : str | None¶
Time Of Day curve to be used in the choice model. These can vary by length of haul, day of week, E-W directionality, etc. If specified here, it will override the curve in the ChoiceModel
- curve : str | None¶
The name of the booking curve that is applied for this demand.
Each demand is attached to a booking curve that describes the temporal distribution of customer arrivals.
- group_sizes : list[float] | None¶
Probability of each group size. i.e. [0.5, 0.3, 0.2] will give 50% one pax, 30% 2 pax, etc
- prob_saturday_night : float | None¶
Probability that the customer has a R/T itinerary with a Saturday night stay. Using this for choice modeling and CP experiments
- prob_num_days : list[float]¶
Probability of durations. [0.1, 0.3, 0.4, 0.2] will have durations of 1, 2, 3, 4 days and probability of each is specified explicitly Using this for choice modeling and CP experiments
- deterministic : bool¶
Whether the total amount of demand generated in each sample should be constant.
If this is true, there will be no variance in the total demand generated, Which will be equal to the base demand modified by any market multipliers. There still can be some randomness in the timeframe arrival distribution of this demand, but the total demand generated in each sample will be the same.
- overrides : list[DemandOverride]¶
Used for some specialized tests. Each dictionary should have ‘carrier’, ‘discount_pct’ and ‘pref_adj’
- property choice_model_ : str¶
Effective choice model name, falling back to segment name if not set.
Returns the explicitly configured
choice_modelwhen present, otherwise falls back tosegmentso that callers always receive a non-Nonemodel name.- Returns:
str – The name of the choice model to use for this demand.