public class MGAPriorityDelayMin2 extends Object implements RunTimeLimit
MGAPriorityDelayMin
.
This is an iterative algorithm that optimize different component(s).
The possible components are :
Since optimizing priority rules, delay and idle agent thresholds simultaneously performs very badly, we do not consider this combination.
Because priority rules seems to have the biggest impact on the performance (and solution cost), the first iteration always optimizes the priority rules component. The following iterations select the component to optimize randomly (combined with a tabu list).
If a component could not improve the solution, then it is put at the end of a tabu list (so it doesn't get chosen at the next iteration).
If the user sets a time limit, then the time is shared evenly by dividing the limit by the number of rounds. Since not all the methods require the same CPU time, the user may want to set a higher time limit.
Modifier and Type | Field and Description |
---|---|
protected int |
lastRunTimeSec
Saves the execution time in second of the last run.
|
protected int |
maxTabuSize
Maximum size of the tabu list.
|
protected static int |
OPT_DELAY
The different routing components that can be optimized at each round of MGA.
|
protected static int |
OPT_PRIORITY
The different routing components that can be optimized at each round of MGA.
|
protected static int |
OPT_PRIORITY_DELAY
The different routing components that can be optimized at each round of MGA.
|
protected static int |
OPT_PRIORITY_MIN
The different routing components that can be optimized at each round of MGA.
|
protected int |
optTimeLimitSec
The optimization time limit in seconds.
|
Constructor and Description |
---|
MGAPriorityDelayMin2(MGAPriorityDelayMin mga,
CallCenterSim sim)
Constructs the optimizer for the given call center evaluator (simulator).
|
Modifier and Type | Method and Description |
---|---|
void |
exportSolution(String outputFn)
Exports the routing solution to a new call center XML parameter file.
|
MGAPriorityDelayMin.Results |
getBestResults()
Returns the best solution found.
|
int |
getLastRunTimeSec()
Returns the total run time the multi-stage MGA in seconds.
|
int |
getTimeLimitSec()
Returns the optimization time limit in seconds.
|
static void |
main(String[] args) |
void |
optimize(int maxRound,
int popSize,
int popEliteSize,
int maxIt,
int maxNoImprIt,
double tol)
Executes the multi-stage modified genetic algorithm (MGA).
|
void |
setTimeLimitSec(int sec)
Sets the optimization time limit in seconds.
|
protected MGAPriorityDelayMin.Results |
updateBestResults(MGAPriorityDelayMin.Results currBest,
MGAPriorityDelayMin.Results newResults)
Updates the best result.
|
protected int maxTabuSize
protected static final int OPT_PRIORITY
protected static final int OPT_PRIORITY_DELAY
protected static final int OPT_PRIORITY_MIN
protected static final int OPT_DELAY
protected int lastRunTimeSec
protected int optTimeLimitSec
public MGAPriorityDelayMin2(MGAPriorityDelayMin mga, CallCenterSim sim)
mga
- the optimizer for the priority rules, delays and idle agent thresholds.
It contains the objective function.sim
- the call center simulatorpublic void setTimeLimitSec(int sec)
setTimeLimitSec
in interface RunTimeLimit
sec
- the time limit in secondspublic int getTimeLimitSec()
getTimeLimitSec
in interface RunTimeLimit
public int getLastRunTimeSec()
getLastRunTimeSec
in interface RunTimeLimit
public void optimize(int maxRound, int popSize, int popEliteSize, int maxIt, int maxNoImprIt, double tol)
maxRound
- the maximum number of round of MGA to perform.popSize
- the size of the population in the MGA.popEliteSize
- the size of the elite population, this cannot be greater than
the population size popSize
.maxIt
- the maximum number of iterations for each round of the multi-stage MGA.
A round of MGA will terminate when the number of iterations exceeds this value.maxNoImprIt
- the maximum number of iterations without improvement (with respect to the
quantile cost) for each round of the multi-stage MGA.
A round of MGA will terminate when the number of consecutive non-improving iterations exceeds this value.tol
- the convergence tolerance on the standard deviation
of the method int, int, int, double)
.protected MGAPriorityDelayMin.Results updateBestResults(MGAPriorityDelayMin.Results currBest, MGAPriorityDelayMin.Results newResults)
currBest
- the current best resultsnewResults
- the new best results (maybe better or not than the current best results)public MGAPriorityDelayMin.Results getBestResults()
public void exportSolution(String outputFn)
outputFn
- the filename of the new parameter file with the best routing solution found