public class MGAWeightRouting extends AbstractMGAWeightRouting
WeightRouting.WeightRouter
.
See the description of AbstractMGAWeightRouting
for a description of the algorithm.
AbstractMGAWeightRouting.Results
Modifier and Type | Field and Description |
---|---|
protected double |
initCoefStd
The initial standard deviation to be used for the coefficient parameters.
|
protected double |
initConstStd
The initial standard deviation to be used for the constant parameters.
|
protected boolean |
positiveConstantWeights
Set to
true to restrict the constant weight parameters to be non-negative. |
protected boolean |
positiveTimeCoeffs
Set to
true to restrict time (agent idle time and call wait time)
coefficients to be non-negative. |
protected WeightRouting.WeightRouter |
router
The weight-based router to optimize.
|
bestResults, bestSolPopRatio, canServe, cc, initUserParams, initUserParamsStdRatio, lastRunTimeSec, maxIt, maxNoImprIt, mgaSmoothing, mgaSmoothingRatio, normalDistMinStd, numDimensions, numGroups, numNormalRatio, numTypes, objFunc, popKeep, popSize, rs, sim, simRepRatio, skillList, timeLimitSec, tol, totalNumSkills
Constructor and Description |
---|
MGAWeightRouting(CallCenterSim sim,
RoutingObjectiveFunc objFunc)
Constructs the MGA optimizer for the given call center simulator and model, and the
objective function to minimize.
|
Modifier and Type | Method and Description |
---|---|
protected int |
computeNumDimensions()
Internal method to return the number of dimensions of the problem
(or the number of variables to optimize).
|
double |
eval(double[] x)
Evaluate the solution and return the cost from the objective function.
|
void |
exportSolution(String outputFn)
Exports the best weight routing solution found to a new
call center XML parameter file.
|
protected double[] |
generateSolution(double[] mean,
double[] std)
Generate a solution from a normal distribution with the given mean and
standard deviation.
|
double[][] |
getBestCallCoeffs()
Get the callCoeffsTG matrix of the best solution found.
|
double[][] |
getBestConstWeights()
Get the constWeightsTG matrix of the best solution found.
|
double[][] |
getBestGroupCoeffs()
Get the groupCoeffsGT matrix of the best solution found.
|
double[][] |
getCallCoeffs(double[] x)
Extracts the call waiting time coefficient matrix from the given solution vector.
|
double[][] |
getConstWeights(double[] x)
Extracts the constant weight matrix from the given solution vector.
|
double[][] |
getGroupCoeffs(double[] x)
Extracts the agent idle time coefficient matrix from the given solution vector.
|
double |
getInitCoefStd()
Get the initial standard deviation of the distributions of the coefficient parameters.
|
double |
getInitConstStd()
Get the initial standard deviation of the distributions of the constant weight parameters.
|
boolean |
getPositiveConstantWeights()
Check if the constant weights are restricted to be non-negative.
|
boolean |
getPositiveTimeCoeffs()
Check if the call waiting time and agent idle time coefficient parameters
are restricted to be non-negative or not.
|
protected double[] |
initializeMean()
Creates a vector that contains the initial mean parameters of the distributions used in the MGA.
|
protected double[] |
initializeStd()
Creates a vector that contains the initial standard deviation parameters of the distributions used in the MGA.
|
protected boolean |
isSolutionValid(double[] x)
Checks if the solution is valid.
|
static void |
main(String[] args) |
protected void |
printExtraInitialParameters()
Method can be overridden to print extra initial parameters.
|
protected void |
printOptimalSolution(double[] x)
Method can be overridden to print the optimal solution.
|
protected void |
restrictToPositiveValues(double[] x)
If the user restrict the weights (constants or time coefficients) to be
non-negative, then this method will change any negative values to 0
(depending on the options
getPositiveConstantWeights()
and getPositiveTimeCoeffs() ). |
void |
setInitCoefStd(double s)
Set the initial standard deviation of the distributions of the
coefficient parameters.
|
void |
setInitConstStd(double s)
Set the initial standard deviation of the distributions of the
constant parameters of the weight routing policy.
|
void |
setPositiveConstantWeights(boolean b)
Choose to restrict the constant weight parameters to be non-negative by setting to true.
|
void |
setPositiveTimeCoeffs(boolean b)
Choose to restrict the call waiting and agent idle time coefficient parameters
to be non-negative by setting to true.
|
protected void |
setRouter()
Internal method to set the router.
|
getBestResults, getBestScore, getBestSolPopRatio, getInitUserParams, getInitUserParamsStdRatio, getLastRunTimeSec, getMGASmoothing, getMGASmoothingRatio, getNumNormalRatio, getRandomStream, getSimRepRatio, getSkillList, getTimeLimitSec, getTotalNumSkills, optimize, setBestSolPopRatio, setInitUserParams, setInitUserParamsStdRatio, setMGASmoothing, setMGASmoothingRatio, setNumNormalRatio, setRandomStream, setSimRepRatio, setTimeLimitSec, updateBestResults
protected WeightRouting.WeightRouter router
protected double initConstStd
initCoefStd
because of the time unit.
For example, when the time is measured in second unit, then the constant parameters
are usually larger than the coefficient parameters, and the standard deviation
of the constant parameters should be expected to be larger also.
On the other hand, if the time is measured in hour unit, then the constant parameters
are usually smaller than the coefficient parameters, and the standard deviation of
the constant parameters are expected to be smaller.protected double initCoefStd
initConstStd
because of the time unit.protected boolean positiveTimeCoeffs
true
to restrict time (agent idle time and call wait time)
coefficients to be non-negative. Negative coefficients will be replaced by 0.
If false
, then the time coefficient parameters can take negative values.protected boolean positiveConstantWeights
true
to restrict the constant weight parameters to be non-negative.
Negative weights will be replaced by 0.
If false
, then the constant weight parameters can take negative values.public MGAWeightRouting(CallCenterSim sim, RoutingObjectiveFunc objFunc)
sim
- the call center simulator.objFunc
- the objective function to minimize.protected void setRouter()
protected int computeNumDimensions()
computeNumDimensions
in class AbstractMGAWeightRouting
public void setPositiveConstantWeights(boolean b)
b
- choose to restrict the constant weight parameters to be non-negative or not.public boolean getPositiveConstantWeights()
public void setPositiveTimeCoeffs(boolean b)
b
- choose to restrict the call waiting and agent idle time coefficient parameters to
be non-negative or not.public boolean getPositiveTimeCoeffs()
public void setInitConstStd(double s)
s
- the initial standard deviation for the constant parameters.public double getInitConstStd()
public void setInitCoefStd(double s)
s
- the initial standard deviation for the coefficient parameters.public double getInitCoefStd()
protected void printExtraInitialParameters()
AbstractMGAWeightRouting
int, int, int, double)
will print the initial parameters
of the optimization function and those present in this abstract class.
But the user can print additional informations with this method.
This method is called before executing the optimization, right after
printing the initial parameters of this abstract class.printExtraInitialParameters
in class AbstractMGAWeightRouting
protected double[] initializeMean()
initializeMean
in class AbstractMGAWeightRouting
protected double[] initializeStd()
initializeStd
in class AbstractMGAWeightRouting
protected void printOptimalSolution(double[] x)
AbstractMGAWeightRouting
printOptimalSolution
in class AbstractMGAWeightRouting
x
- the solution vector to printprotected double[] generateSolution(double[] mean, double[] std)
AbstractMGAWeightRouting
generateSolution
in class AbstractMGAWeightRouting
mean
- the mean of each variable.std
- the standard deviation of each variable.protected void restrictToPositiveValues(double[] x)
getPositiveConstantWeights()
and getPositiveTimeCoeffs()
).
Warning: this method will modify directly the array x.
This method assumes that x is an array of size 3S, where
S is the total number of skills, and the first S elements correspond
to the constant weights.
The user can pass an array x longer than 3S, but only the
first 3S will be checked and possibly modified.x
- the weight solution.protected boolean isSolutionValid(double[] x)
The user can override this method for a more sophisticated procedure.
isSolutionValid
in class AbstractMGAWeightRouting
x
- the solution verify its validity.public double[][] getConstWeights(double[] x)
x
- the solution vector.public double[][] getCallCoeffs(double[] x)
x
- the solution vector.public double[][] getGroupCoeffs(double[] x)
x
- the solution vector.public double eval(double[] x)
AbstractMGAWeightRouting
eval
in class AbstractMGAWeightRouting
x
- the solutionpublic double[][] getBestConstWeights()
public double[][] getBestCallCoeffs()
public double[][] getBestGroupCoeffs()
public void exportSolution(String outputFn)
exportSolution
in class AbstractMGAWeightRouting
outputFn
- filename of the XML file to create.