RmSys¶
-
class passengersim.rm.RmSys(carrier: str, cfg: Config | None =
None, **kwargs)[source]¶ Bases:
objectA revenue management (RM) system that executes a sequence of RM actions.
Initialize the RM system.
- Parameters:
- carrier : str¶
The carrier code for which this RM system is configured.
- cfg : Config, optional¶
The top level configuration object for the simulation, which is also used to help initialize this system. For example, the collection of data collection points (DCPs) given as days prior to departure, is used for steps that have a frequency of “DCP” to identify which days to run.
- **kwargs¶
Additional keyword arguments to configure the RM actions in this system.
- Raises:
ValueError – If availability_control is not defined, or if no actions are defined, or if any provided keyword argument does not match any action’s configuration options.
Methods
__init__(carrier[, cfg])Initialize the RM system.
get_name()Get the name of this RM system class.
run(sim, days_prior)Run all actions in the RM system's action queue.
Attributes
List of RM actions (or action factories) to execute in this RM system.
The type of availability control used in this RM system.
Priority of this RM system when scheduled as an event callback.
List of RM actions to be executed in order.
-
priority : int =
-1¶ Priority of this RM system when scheduled as an event callback.
The default setting is -1, which means it will run just before other daily callbacks with the default priority of 0.
-
availability_control : Literal['leg', 'cabin', 'bp', 'bp_loose', 'classless', None] =
None¶ The type of availability control used in this RM system.
The selected availability control is injected into the Carrier object at the time it is created in the simulation, as this setting is used during the passenger arrival simulation loop, and instead of during the RM system steps run from the action queue each day.
Subclasses of RmSys must set this class variable to one of the allowed values (other than None) to indicate the type of availability control used by that RM system.
-
actions : list[RmActionFactory | type[RmAction]] =
[]¶ List of RM actions (or action factories) to execute in this RM system.
Each item in this list should be either an RmActionFactory instance, or an RmAction subclass. If an RmAction subclass is provided, its configure() class method will be called to create an RmActionFactory with no configurable parameters.
Subclasses of RmSys must set this class variable to a non-empty list of actions to be executed in order when this RM system runs.
-
__init__(carrier: str, cfg: Config | None =
None, **kwargs)[source]¶ Initialize the RM system.
- Parameters:
- carrier : str¶
The carrier code for which this RM system is configured.
- cfg : Config, optional¶
The top level configuration object for the simulation, which is also used to help initialize this system. For example, the collection of data collection points (DCPs) given as days prior to departure, is used for steps that have a frequency of “DCP” to identify which days to run.
- **kwargs¶
Additional keyword arguments to configure the RM actions in this system.
- Raises:
ValueError – If availability_control is not defined, or if no actions are defined, or if any provided keyword argument does not match any action’s configuration options.
- action_queue : list[RmAction]¶
List of RM actions to be executed in order.
- run(sim: Simulation, days_prior: int) None[source]¶
Run all actions in the RM system’s action queue.
This will call all the actions in the action queue in order, passing the simulation and days prior to each action’s run method. Each action should handle its own logic for whether it should execute based on the current simulation state and days prior.