public class StochFluidCC extends Object
AbanRatioFinder
.
This step also selects the scenarios that need to be satisfied.
By default, the method to generate the maximum abandonment ratio thresholds is ServiceLevelToAbanRatio
.
If the user implements his own method (with the interface AbanRatioFinder
), then
he must set his method using setAbanRatioFinder(umontreal.iro.lecuyer.ccoptim.stochcp.AbanRatioFinder)
before executing the optimization optimize()
.
The recourse variables can be enabled by setting the parameter ScenariosParams.useRecourse
to true
(default value).
The period to optimize is set by the parameter StochFluidParams.currentPeriod
and it will override the simulator parameter BatchSimParams.getCurrentPeriod()
.
If the simulator parameter is RepSimParams
, then the call center must only have 1 period,
and the current period will be automatically set to 0.
Modifier and Type | Class and Description |
---|---|
static class |
StochFluidCC.WithLog
This subprogram allows the execution of the program
StochFluidCC and log of the output to a file. |
Modifier and Type | Field and Description |
---|---|
protected AbanRatioFinder |
abanRatioFinder
This object is used to get the maximum abandonment ratio thresholds for the fluid algorithm.
|
protected StochSolution |
bestSolution
The best stochastic solution found.
|
protected CallCenter |
cc
The call center model.
|
protected int |
currPeriod
The period to optimize.
|
protected int |
numGroups
The number of agent groups.
|
protected int |
numScenarios
The number of scenarios.
|
protected int |
numTypes
The number of call types.
|
protected double[] |
rMinusCost
The recourse cost of the variables
StochSolution.getRMinus() for removing agents. |
protected double[] |
rPlusCost
The recourse cost of the variables
StochSolution.getRPlus() for adding more agents. |
protected ScenariosParams |
scenParams
The scenario parameters.
|
protected StochFluidParams |
sfParams
The stochastic fluid algorithm parameters.
|
protected List<SimParams> |
simpList
The list of simulation parameters, one for each scenario.
|
protected double[] |
staffCost
The cost vector (of each group) for the staffing problem.
|
Constructor and Description |
---|
StochFluidCC(StochFluidParams sfParams,
ScenariosParams scenParams,
List<SimParams> simpList)
Instantiates the stochastic fluid optimization object with the given parameters.
|
Modifier and Type | Method and Description |
---|---|
protected List<? extends CallCenterSim> |
createListSimulator()
Creates a list of simulators for each scenario.
|
AbanRatioFinder |
getAbanRatioFinder()
Returns the object that is used to obtain the maximum abandonment ratio thresholds.
|
StochSolution |
getBestSolution()
Returns the best solution found for the stochastic staffing problem.
|
double[] |
getStaffingCostVector()
Returns the staffing cost vector used (for each agent group).
|
StochFluidParams |
getStochFluidParams()
Returns the parameter object
StochFluidParams of this instance. |
protected void |
localSearch(double[] staffCost,
List<? extends CallCenterSim> simList,
int maxCPUSec)
Executes the local search on the best solution.
|
static void |
main(String[] args)
Optimizes the stochastic staffing problem with chance constraint using the fluid model.
|
void |
optimize()
Executes the stochastic fluid staffing optimization.
|
protected double[][] |
optimizeAbanRatio(double[][] arrivalRates,
double[][] initAbanRatio,
List<? extends CallCenterSim> simList,
boolean solveIP,
int maxCPUSec) |
void |
setAbanRatioFinder(AbanRatioFinder a)
Sets the object to obtain the maximum abandonment ratio thresholds.
|
protected void |
verbosePrint(String s)
Calls the method
System.out.print(s) , where s is the argument,
if the verbose parameter StochFluidParams.verbose is
set to true . |
protected void |
verbosePrintln(String s)
Calls the method
System.out.println(s) , where s is the argument,
if the verbose parameter StochFluidParams.verbose is
set to true . |
protected ScenariosParams scenParams
protected StochFluidParams sfParams
protected List<SimParams> simpList
protected CallCenter cc
protected final int numGroups
protected final int numTypes
protected StochSolution bestSolution
protected final int numScenarios
protected final int currPeriod
StochFluidParams.currentPeriod
at the creation of this object.
This parameter should not be changed after this object has been created.
If the user is using RepSimParams
, then there must be only 1 period, and
this parameter must be set to 0.protected double[] staffCost
protected double[] rPlusCost
StochSolution.getRPlus()
for adding more agents.protected double[] rMinusCost
StochSolution.getRMinus()
for removing agents.
This value must be positive, since the algorithm will subtract this cost from
the objective cost.protected AbanRatioFinder abanRatioFinder
public StochFluidCC(StochFluidParams sfParams, ScenariosParams scenParams, List<SimParams> simpList)
It is highly suggested that the parameters do not change after the construction of this object, because the modifications may not necessarily take effect.
sfParams
- the stochastic fluid optimization parametersscenParams
- the scenario parameters for the stochastic problemsimpList
- the simulator parameters for each scenariopublic StochFluidParams getStochFluidParams()
StochFluidParams
of this instance.public void setAbanRatioFinder(AbanRatioFinder a)
a
- the object to obtain the maximum abandonment ratio thresholdspublic AbanRatioFinder getAbanRatioFinder()
public void optimize() throws ilog.concert.IloException
StochFluidParams.useLocalSearch
is
set to true
.ilog.concert.IloException
- if an error occurred with Cplexprotected double[][] optimizeAbanRatio(double[][] arrivalRates, double[][] initAbanRatio, List<? extends CallCenterSim> simList, boolean solveIP, int maxCPUSec) throws ilog.concert.IloException
ilog.concert.IloException
protected List<? extends CallCenterSim> createListSimulator()
public StochSolution getBestSolution()
IllegalStateException
- if the optimization has not been executedpublic double[] getStaffingCostVector()
CuttingPlaneOptimizer
.
See the parameter StochFluidParams.staffSkillCost
for more details.
protected void localSearch(double[] staffCost, List<? extends CallCenterSim> simList, int maxCPUSec)
staffCost
- the cost vector of the staffing (not the recourse cost vector)simList
- the list of simulators, one for each scenariomaxCPUSec
- the maximum CPU time allocated for the local searchprotected void verbosePrint(String s)
System.out.print(s)
, where s
is the argument,
if the verbose parameter StochFluidParams.verbose
is
set to true
.
No line return is added at the end of this string.s
- the string to printprotected void verbosePrintln(String s)
System.out.println(s)
, where s
is the argument,
if the verbose parameter StochFluidParams.verbose
is
set to true
.
This method adds a line feed at the end of this string.s
- the string to printpublic static void main(String[] args) throws Exception
ScenariosParams.chanceConstraintProb
, of the possible scenarios.
The arguments are:
args
- see the descriptionException