public class FluidRatioStaffing extends Object implements StaffingOptimizer
The simulator parameter must evaluate the following performance measures:
PerformanceMeasureType.SERVICELEVEL
, PerformanceMeasureType.ABANDONMENTRATIO
and
PerformanceMeasureType.SERVEDRATES
.
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 StaffingSolution |
bestSolution
Contains the best solution found, or
null if the optimization
has not been executed. |
protected CallCenter |
cc
The call center model.
|
protected int |
currPeriod
The period to optimize.
|
protected FluidStaffingParams |
fsParams
The parameters of the fluid optimization.
|
double |
lowerBoundGap
Parameter to control the gap of the lower bound in order to control the neighborhood search.
|
protected int |
numGroups
The number of agent groups.
|
protected int |
numTypes
The number of call types.
|
protected CallCenterSim |
sim
The call center simulator.
|
Constructor and Description |
---|
FluidRatioStaffing(CallCenterSim sim,
FluidStaffingParams fsParams) |
Modifier and Type | Method and Description |
---|---|
double |
computeCost(int[] staffing)
Compute the cost of the given staffing vector.
|
protected void |
correctRounding(int[] y,
double[] arrivalRates)
Corrects the rounded solution vector
y such that every call type with
positive (non-zero) arrival rate should have at least one agent that can serve it. |
protected void |
executeSimCorrector(int maxCPUSec) |
AbanRatioFinder |
getAbanRatioFinder()
Returns the object that is used to obtain the maximum abandonment ratio thresholds.
|
int[] |
getBestStaffing()
Returns the best feasible staffing vector found.
|
double |
getBestStaffingCost()
Returns the cost of the best staffing solution found.
|
protected int[] |
getLowerBound(int[] staffing)
Returns the lower bound of each agent group for the staffing problem.
|
double[] |
getStaffingCostVector()
Returns the cost vector of each group, per agent.
|
protected void |
localSearch(int maxCPUSec)
Executes the local search on the best solution.
|
static void |
main(String[] args)
Runs the optimization with the entered parameters files.
|
void |
optimize()
Runs the optimization algorithm.
|
protected void |
optimizeAbanRatio(double[] arrivalRates,
double[] abanRatio,
double[][] workRatio,
boolean solveIP,
int maxCPUSec)
Optimizes the abandonment ratio thresholds and the work ratios for the fluid model.
|
protected String |
readServedRatesRatio(DoubleMatrix2D servedRates) |
protected String |
readSL(DoubleMatrix2D sl)
Created a String that contains the service levels
|
void |
setAbanRatioFinder(AbanRatioFinder a)
Sets the object to obtain the maximum abandonment ratio thresholds.
|
protected void |
simEval(int[] staffing)
Simulates the given staffing vector.
|
protected void |
verbosePrint(String s)
Calls the method
System.out.print(s) , where s is the argument,
if the verbose parameter FluidStaffingParams.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 FluidStaffingParams.verbose is
set to true . |
protected FluidStaffingParams fsParams
protected CallCenter cc
protected CallCenterSim sim
protected final int numGroups
protected final int numTypes
protected StaffingSolution bestSolution
null
if the optimization
has not been executed.protected AbanRatioFinder abanRatioFinder
protected final int currPeriod
FluidStaffingParams.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.public double lowerBoundGap
public FluidRatioStaffing(CallCenterSim sim, FluidStaffingParams fsParams)
public void optimize() throws OptimizerException
StaffingOptimizer
optimize
in interface StaffingOptimizer
OptimizerException
- if an error occurred in the optimizationprotected void optimizeAbanRatio(double[] arrivalRates, double[] abanRatio, double[][] workRatio, boolean solveIP, int maxCPUSec) throws ilog.concert.IloException
abanRatio
and workRatio
are modified and they contain the results.
The number of iterations is set by the parameter FluidStaffingParams.maxAbanIter
.arrivalRates
- the arrival rate of each call typeabanRatio
- the abandonment ratio threshold for each call type, followed by the
threshold for aggregated calls (if more than 1 call type).
This parameter will be modified and will contain the result.workRatio
- the work allocation ratio of each group on each call type. The sum of ratios
of each group over all call types should be equal to 1.
This parameter will be modified and will contain the result.solveIP
- solve the problem with integer staffing variablesmaxCPUSec
- the maximum time limit given to this methodilog.concert.IloException
protected void localSearch(int maxCPUSec)
maxCPUSec
- the maximum CPU time allocated for the local searchprotected void executeSimCorrector(int maxCPUSec)
protected void simEval(int[] staffing)
sim
.staffing
- the staffing vector to simulateprotected String readSL(DoubleMatrix2D sl)
sl
- the service levelprotected String readServedRatesRatio(DoubleMatrix2D servedRates)
public double[] getStaffingCostVector()
public double getBestStaffingCost()
StaffingOptimizer
getBestStaffingCost
in interface StaffingOptimizer
public int[] getBestStaffing()
StaffingOptimizer
getBestStaffing
in interface StaffingOptimizer
public void setAbanRatioFinder(AbanRatioFinder a)
a
- the object to obtain the maximum abandonment ratio thresholdspublic AbanRatioFinder getAbanRatioFinder()
protected void verbosePrint(String s)
System.out.print(s)
, where s
is the argument,
if the verbose parameter FluidStaffingParams.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 FluidStaffingParams.verbose
is
set to true
.
This method adds a line feed at the end of this string.s
- the string to printprotected void correctRounding(int[] y, double[] arrivalRates)
y
such that every call type with
positive (non-zero) arrival rate should have at least one agent that can serve it.
If the arrival rate of call type k is bigger than 0, but there are no agents that can serve
this call type, then set the cheapest agent group than can serve it to 1.y
- the rounded staffing vectorarrivalRates
- the arrival rate of each call typeprotected int[] getLowerBound(int[] staffing)
staffing
- the current staffing solutionpublic double computeCost(int[] staffing)
staffing
- the staffing vector