public class PbkStaffing extends Object implements NumFunction
PbkStaffingParams
.
The algorithm minimizes the staffing cost while satisfying the service level target.
For a given total number of agents n, the algorithm solves the Lagrangian dual with respect
to the relaxation of the global service level constraint.
In our variant, there is the option PbkStaffingParams.ignoreSlPerCallType
to restrict the algorithm to return a feasible solution that also satisfy the SL per call type.
However, this option has a very crude effect in the optimization where it only affects the
feasibility criteria of a solution.
If there are SL targets for the call types, it is preferable to use the algorithms
If one uses the call center simulator of ContactCenters as the ContactCenterEval
,
then it should use simulation by batches (for steady-state simulation) with
BatchSimParams
ant not RepSimParams
, unless there is only one period.
The period to optimize and the cost per agent type are set in the parameter class PbkStaffingParams
.
This algorithm optimizes only one period, and this period is set with the parameter PbkStaffingParams.currentPeriod
,
The call center evaluation should implement ContactCenterEval.hasEvalOption(umontreal.iro.lecuyer.contactcenters.app.EvalOptionType)
and this method must return true
for option type EvalOptionType.CURRENTPERIOD
.
The evaluator must also implement java.lang.Object)
with option type EvalOptionType.CURRENTPERIOD
.
A list of available call center evaluators is given in CCEvaluatorFactory.EvaluatorType
.
Modifier and Type | Class and Description |
---|---|
static class |
PbkStaffing.LocalSearchResults
The results of the local search.
|
static class |
PbkStaffing.TotalNumberNResults
Contains the solution of the Lagrangian dual for a fixed number of agents.
|
Constructor and Description |
---|
PbkStaffing(CallCenter cc,
ContactCenterEval eval,
PbkStaffingParams pbkParams)
Creates a new instance of the optimizer.
|
Modifier and Type | Method and Description |
---|---|
double |
eval(double x)
Evaluates the single dimension function.
|
double |
getStaffingCost(int[] staffing)
Returns the cost of the given staffing vector.
|
boolean |
isFeasible(DoubleMatrix2D sl)
Checks if the service level targets are met.
|
PbkStaffing.LocalSearchResults |
localSearch(int[] staffing,
double beta)
Executes the local search on the given staffing vector.
|
static void |
main(String[] args)
Runs the staffing optimizer.
|
int[] |
optimize()
Optimizes the total number of agents using the golden section search.
|
PbkStaffing.TotalNumberNResults |
optimizeTotalNumberN(int n)
Finds the optimal staffing with a total number of n agents.
|
PbkStaffing.TotalNumberNResults |
optimizeTotalNumberN(int[] staffing)
Finds the optimal staffing with a total number of n agents.
|
public PbkStaffing(CallCenter cc, ContactCenterEval eval, PbkStaffingParams pbkParams)
cc
- the call center parameterseval
- the call center evaluatorpbkParams
- the parameters of the optimizerpublic PbkStaffing.TotalNumberNResults optimizeTotalNumberN(int n)
Before optimizing β, we first test if there exists a feasible staffing with n agents. To do this, we first try β = βmax of the bisection interval [βmin, βmax], where βmin = 0 and βmax is a large number.
n
- the total number of agents.public PbkStaffing.TotalNumberNResults optimizeTotalNumberN(int[] staffing)
optimizeTotalNumberN(int)
but starts the local search
with the given staffing. The sum of agents in staffing equals to n.staffing
- the starting point of the local search and the sum of agents corresponds to n.
This parameter remains untouched.public PbkStaffing.LocalSearchResults localSearch(int[] staffing, double beta)
staffing
- the starting point of the local search, this parameter remains unchanged.beta
- the Lagrangian multiplier of the global service level constraint.public boolean isFeasible(DoubleMatrix2D sl)
PbkStaffingParams.ignoreSlPerCallType
is false
,
then this method will also check the satisfaction of SL for each call type.
If that parameter is set to true
, then only the aggregated SL is checked.sl
- the service level to checktrue
if the service level target(s) are metpublic double getStaffingCost(int[] staffing)
staffing
- the staffing vectorpublic int[] optimize()
The lower bound nl of the golden section search is determined by solving an Erlang C queueing formula while considering all groups as generalists with the fastest service rate. The upper bound nu of the golden section search is determined by analyzing each call type as independent call center with the slowest service rate of that call type. The Erlang C formula is solved for each call type and nu is the sum of the agents.
public double eval(double x)
NumFunction
eval
in interface NumFunction
x
- the variable of the function to evaluate.public static void main(String[] args) throws Exception
The program requires as input:
RepSimParams
, BatchSimParams
, LossDelayParams
or KooleTalimParams
.
Using RepSimParams or BatchSimParams will create the evaluator CallCenterSim
.
However, RepSimParams should not be used if there are multiple periods!
Using KooleTalimParams will create the evaluator KooleTalimApproxBSL
.
PbkStaffingParams
.
args
- see the method's descriptionException