make_rm_system_variant¶
- passengersim.rm.systems.make_rm_system_variant(new_cls: type[RmSys]) type[RmSys][source]¶
Define a named variant of an existing RM system, with particular options.
Use this decorator on a class which defines alternative default values for RmSys options, and which inherits from an existing RmSys class. This will create a new RM system class with these defined values as the defaults, and register it with the name of the new class.
- Raises:
ValueError – The an RM system class with the given name is already registered.
Examples
To start with the existing Qu system, but change the default fare adjustment algorithm to ki and the fare adjustment to 0.25, do
>>> from passengersim.rm.standard_systems import Qu >>> @make_rm_system_variant ... class Qu25(Qu): ... fare_adjustment = "ki" ... fare_adjustment_scale = 0.25