MultiErlangC

MultiErlangC(param_grid[, n_jobs, pre_dispatch])

Runs Erlang C calculations over multiple parameter combinations.

MultiErlangC.waiting_probability(arguments_grid)

Returns the probability of waiting in the queue Returns a list with the solution to all the possible combinations from the arguments_grid and the erlangc.rst param_grid

MultiErlangC.service_level(arguments_grid)

Returns the expected service level given a number of positions Returns a list with the solution to all the possible combinations from the arguments_grid and the erlangc.rst param_grid

MultiErlangC.achieved_occupancy(arguments_grid)

Returns the expected occupancy of positions Returns a list with the solution to all the possible combinations from the arguments_grid and the erlangc.rst param_grid

MultiErlangC.required_positions(arguments_grid)

Computes the requirements using MultiErlangC Returns a list with the solution to all the possible combinations from the arguments_grid and the erlangc.rst param_grid

class pyworkforce.queuing.MultiErlangC(param_grid: dict, n_jobs: int = 2, pre_dispatch: str = '2 * n_jobs')[source]

Runs Erlang C calculations over multiple parameter combinations.

This class uses joblib’s Parallel to evaluate every combination from param_grid and the method-specific argument grid. Its interface is inspired by scikit-learn’s grid search utilities.

Parameters:
param_grid: dict,

Dictionary with ErlangC initialization parameters. Each key must be an expected parameter, and each value must be a list of options to iterate over. example: {“transactions”: [100, 200], “aht”: [3], “interval”: [30], “asa”: [20 / 60], “shrinkage”: [0.3]}

n_jobs: int, default=2

Maximum number of concurrently running jobs. If -1 all CPUs are used. If 1 is given, no parallel computing code is used at all, which is useful for debugging. For n_jobs below -1, (n_cpus + 1 + n_jobs) are used. Thus for n_jobs = -2, all CPUs but one are used. None is a marker for ‘unset’ that will be interpreted as n_jobs=1 (sequential execution) unless the call is performed under a parallel_backend() context manager that sets another value for n_jobs.

pre_dispatch: {“all”, int, or expression}, default=’2 * n_jobs’

Number of task batches to pre-dispatch. Default is 2*n_jobs. See joblib’s documentation for more details: https://joblib.readthedocs.io/en/latest/generated/joblib.Parallel.html

Attributes:
waiting_probability_params: list[tuple],

Parameters used for each waiting_probability result, in result order.

service_level_params: list[tuple],

Parameters used for each service_level result, in result order.

achieved_occupancy_params: list[tuple],

Parameters used for each achieved_occupancy result, in result order.

required_positions_params: list[tuple],

Parameters used for each required_positions result, in result order.

achieved_occupancy(arguments_grid)[source]

Returns the expected occupancy of positions Returns a list with the solution to all the possible combinations from the arguments_grid and the erlangc.rst param_grid

Parameters:
arguments_grid: dict,

Dictionary with the erlangc.rst.achieved_occupancy parameters, each key of the dictionary must be the expected parameter and the value must be a list with the different options to iterate example: {“positions”: [10, 20, 30], “scale_positions”: [True, False]}

required_positions(arguments_grid)[source]

Computes the requirements using MultiErlangC Returns a list with the solution to all the possible combinations from the arguments_grid and the erlangc.rst param_grid

Parameters:
arguments_grid: dict,

Dictionary with the erlangc.rst.achieved_occupancy parameters, each key of the dictionary must be the expected parameter and the value must be a list with the different options to iterate example: {“service_level”: [0.85, 0.9], “max_occupancy”: [0.8, 0.95]}

service_level(arguments_grid)[source]

Returns the expected service level given a number of positions Returns a list with the solution to all the possible combinations from the arguments_grid and the erlangc.rst param_grid

Parameters:
arguments_grid: dict,

Dictionary with the erlangc.rst.service_level parameters, each key of the dictionary must be the expected parameter and the value must be a list with the different options to iterate example: {“positions”: [10, 20, 30], “scale_positions”: [True, False]}

waiting_probability(arguments_grid)[source]

Returns the probability of waiting in the queue Returns a list with the solution to all the possible combinations from the arguments_grid and the erlangc.rst param_grid

Parameters:
arguments_grid: dict,

Dictionary with the erlangc.rst.waiting_probability parameters, each key of the dictionary must be the expected parameter and the value must be a list with the different options to iterate example: {“positions”: [10, 20, 30], “scale_positions”: [True, False]}