public class FluidCCProblem extends Object
ServiceLevelToAbanRatio
.
The arrival rate λk of call type k will differ for different scenarios, but the mean service times and mean patience times must not change between scenarios.
The chance constraint is defined on the feasibility of the scenarios. It requires that a proportion of scenarios to must be feasible.
Note: the user can select to use recourse variables (default option) or
without recourse variables using the method setUseRecourse(boolean)
.
Modifier and Type | Field and Description |
---|---|
protected double[][] |
abanThresholds
The maximum abandonment ratio thresholds for all call types and the aggregate calls.
|
protected double[][] |
arrivalRates
The arrival rates of each call type for each scenario, with index
[type][scenario] . |
protected CallCenter |
cc
The call center model.
|
protected ilog.cplex.IloCplex |
cplex
The Cplex instance that represents the recourse problem.
|
protected int |
currPeriod
The current period to be optimized.
|
protected HashMap<String,ilog.concert.IloNumVar> |
flowVarMap
A hash map that contains the flow covering variables with key String
w:k,i,m where k is the call type number, i is
the group number and m is the scenario number. |
protected static int |
LARGE_NUMBER
Represents an arbitrary large number.
|
protected List<CallCenter> |
listCallCenter
This list is used to read the arrival rates and mean service times without re-creating
the call center models.
|
protected int |
numGroups
The number of agent groups.
|
protected int |
numScenarios
The number of scenarios, defined by
scenParams . |
protected int |
numTypes
The number of call types.
|
protected double[] |
rMinusCost
The recourse cost of the variables
rMinusVar for removing agents. |
protected ilog.concert.IloNumVar[][] |
rMinusVar
The recourse r- variables, with indices
[group][scenario] . |
protected double[] |
rPlusCost
The recourse cost of the variables
rPlusVar for adding more agents. |
protected ilog.concert.IloNumVar[][] |
rPlusVar
The recourse r+ variables, with indices
[group][scenario] . |
protected ScenariosParams |
scenParams
The scenario parameters.
|
protected ilog.concert.IloNumVar[] |
scenVar
The binary variables that determine if a scenario must be satisfied or not.
|
protected boolean |
solveIP
Parameter that determines if this recourse problem must be solved by
integer programming (set to
true ) or relaxed to a linear problem. |
protected double[] |
staffCost
The staffing cost per agent for each group (for the variables
yVar . |
protected boolean |
useRecourse
Set to
true to use recourse variables, or set to false to remove them from
the stochastic problem. |
protected ilog.concert.IloNumVar[] |
yVar
The staffing variable, with index
[group] . |
protected ilog.concert.IloNumVar[][] |
zVar
The z corrector variables, with indices
[group][scenario] . |
Constructor and Description |
---|
FluidCCProblem(CallCenter cc,
ScenariosParams scenParams,
double[] staffCost,
int currentPeriod,
boolean solveIP)
Constructs the stochastic staffing problem with recourse and chance constraint.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addFlowConstraints(double[][] arrivalRates,
double[][] abanThresholds)
Adds the flow covering constraints.
|
protected void |
addFlowVariables()
Creates the flow covering variables.
|
ilog.cplex.IloCplex |
buildProblem(double[][] arrivalRates,
double[][] abanThresholds)
Build the stochastic staffing problem with recourse and chance constraint with Cplex.
|
ilog.cplex.IloCplex |
getCplexModel()
Returns the Cplex model, ready to be solved, or returns
null
if buildProblem(double[][], double[][]) has not been executed yet. |
boolean |
getUseRecourse()
Checks if the recourse variables are used.
|
protected void |
initIP()
Initializes the integer variables.
|
protected void |
initLP()
Initializes the continuous variables (but not the flow covering variables).
|
void |
setUseRecourse(boolean b)
Sets to use recourse variables if
true , or set to false to remove
them from the stochastic problem. |
protected final CallCenter cc
protected final ScenariosParams scenParams
protected final int numScenarios
scenParams
.protected final int numTypes
protected final int numGroups
protected final boolean solveIP
true
) or relaxed to a linear problem.protected ilog.cplex.IloCplex cplex
protected ilog.concert.IloNumVar[] yVar
[group]
.protected ilog.concert.IloNumVar[][] rPlusVar
[group][scenario]
.protected ilog.concert.IloNumVar[][] rMinusVar
[group][scenario]
.protected HashMap<String,ilog.concert.IloNumVar> flowVarMap
w:k,i,m
where k
is the call type number, i
is
the group number and m
is the scenario number.protected double[] staffCost
yVar
.protected double[] rPlusCost
rPlusVar
for adding more agents.protected double[] rMinusCost
rMinusVar
for removing agents.
This value must be positive, since the algorithm will subtract this cost from
the objective cost.protected double[][] abanThresholds
[call type][scenario]
.
Let K be the number of call types and M the number of scenarios. If K = 1, then this matrix must be of size 1×M. If K >= 2, this matrix must be of size (K + 1)×M, with element index 0 to K - 1 corresponding to the call types and element K corresponding to the aggregated call types.
protected double[][] arrivalRates
[type][scenario]
.protected int currPeriod
protected List<CallCenter> listCallCenter
protected boolean useRecourse
true
to use recourse variables, or set to false
to remove them from
the stochastic problem.
This parameter must be set before calling double[][])
.protected static int LARGE_NUMBER
protected ilog.concert.IloNumVar[] scenVar
[scenario]
.protected ilog.concert.IloNumVar[][] zVar
[group][scenario]
.
These are the cost corrector variables when solving with chance constraints.public FluidCCProblem(CallCenter cc, ScenariosParams scenParams, double[] staffCost, int currentPeriod, boolean solveIP)
cc
- the call center model, this is used to read all the parameters, except the arrival rates which must
be given separately to the method double[][])
scenParams
- the scenario parametersstaffCost
- the per-agent staffing cost vectorsolveIP
- set to true
to create an MIP problem, or false
to create an LP problempublic void setUseRecourse(boolean b)
true
, or set to false
to remove
them from the stochastic problem.
This parameter must be set before calling double[][])
.b
- the value to setpublic boolean getUseRecourse()
public ilog.cplex.IloCplex buildProblem(double[][] arrivalRates, double[][] abanThresholds) throws ilog.concert.IloException
arrivalRates
- the arrival rates of each call type for each scenario, with index [type][scenario]
.
This matrix must be of size
K×M, where K is the number of call types and M is
the number of scenarios.abanThresholds
- the maximum abandonment ratio thresholds for each call type and aggregated call type,
and for each scenario.
The matrix has indexes [call type][scenario]
.
Let K be the number of call types and M the number of scenarios. If K = 1, then this matrix must be of size 1×M. If K >= 2, this matrix must be of size (K + 1)×M, with element index 0 to K - 1 corresponding to the call types and element K corresponding to the aggregated call types.
ilog.concert.IloException
- an error occurred while creating the problem with Cplexprotected void initIP() throws ilog.concert.IloException
ilog.concert.IloException
protected void initLP() throws ilog.concert.IloException
ilog.concert.IloException
protected void addFlowVariables() throws ilog.concert.IloException
ilog.concert.IloException
protected void addFlowConstraints(double[][] arrivalRates, double[][] abanThresholds) throws ilog.concert.IloException
double[][])
.arrivalRates
- the arrival rates for each call type and each scenario, with indexes [type][scenario]
abanThresholds
- the maximum abandonment ratio threshold for each call type and aggregated calls, and for each scenario.
See method double[][])
.ilog.concert.IloException
public ilog.cplex.IloCplex getCplexModel()
null
if buildProblem(double[][], double[][])
has not been executed yet.null
if buildProblem(double[][], double[][])
has not been executed yet