public class MGAWeightRoutingVector extends AbstractMGAWeightRouting
Summary of the algorithm:
To reduce the simulation time, the solutions are not simulated with less than the normal number of replications. Then only the good solution candidates are re-simulated with the normal number of replications.
The structure of the solution vector is: [numTypes + numTypes + numGroups + numGroups], where the elements correspond to constant call weights, call coefficients, constant group weights and group coefficients.
AbstractMGAWeightRouting.Results
Modifier and Type | Field and Description |
---|---|
protected double |
initCoefStd |
protected double |
initConstStd |
protected boolean |
positiveConstantWeights
Set to true to restrict the constant weights to be non-negative.
|
protected boolean |
positiveTimeCoeffs
Set to true to restrict time (idle time and wait time)
coefficients to be non-negative.
|
protected WeightRoutingVector.WeightRouterVector |
router |
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 |
---|
MGAWeightRoutingVector(CallCenterSim sim,
RoutingObjectiveFunc objFunc) |
Modifier and Type | Method and Description |
---|---|
protected int |
computeNumDimensions()
This method is internal since it's created so that it can be overridden.
|
double |
eval(double[] x)
Evaluate the solution and return the cost from the objective function.
|
void |
exportSolution(String outputFn)
Create a parameter file that represents the model with the best routing solution found.
|
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 callCoeffs vector for the best solution found.
|
double[] |
getBestConstCallWeights()
Get the constCallWeights vector of the best solution found.
|
double[] |
getBestConstGroupWeights()
Get the constGroupWeights vector of the best solution found.
|
double[] |
getBestGroupCoeffs()
Get the groupCoeffs vector for the best solution found.
|
double[] |
getCallCoeffs(double[] x)
Extract the call waiting time coefficient vector from the given solution vector.
|
double[] |
getConstCallWeights(double[] x)
Extract the constant call weights from the given solution vector.
|
double[] |
getConstGroupWeights(double[] x)
Extract the constant group weights from the given solution vector.
|
double[] |
getGroupCoeffs(double[] x)
Extract the group idle time coefficient vector from the given solution vector.
|
double |
getInitCoefStd()
Get the initial standard deviation for the coefficient parameters.
|
double |
getInitConstStd()
Get the initial standard deviation for the constant parameters.
|
boolean |
getPositiveConstantWeights()
Verifies if the constant weights are restricted to be non-negative.
|
boolean |
getPositiveTimeCoeffs()
Verifies if the waiting times and idle times are restricted to be non-negative.
|
protected double[] |
initializeMean()
Method to initialize the mean vector.
|
protected double[] |
initializeStd()
Method of initialize the standard deviation vector.
|
protected boolean |
isSolutionValid(double[] x)
Check if the solution if 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.
|
void |
setInitCoefStd(double s)
Set the initial standard deviation to generate the starting solutions for the
coefficient parameters of the weight routing policy.
|
void |
setInitConstStd(double s)
Set the initial standard deviation to generate the starting solutions for the
constant parameters of the weight routing policy.
|
void |
setPositiveConstantWeights(boolean b)
Chooses to restrict the constant weights to be non-negative or not.
|
void |
setPositiveTimeCoeffs(boolean b)
Chooses to restrict the wait and idle time coefficients to be non-negative or not.
|
protected void |
setRouter()
Method to set different 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 WeightRoutingVector.WeightRouterVector router
protected double initConstStd
protected double initCoefStd
protected boolean positiveTimeCoeffs
protected boolean positiveConstantWeights
public MGAWeightRoutingVector(CallCenterSim sim, RoutingObjectiveFunc objFunc)
protected void setRouter()
protected int computeNumDimensions()
computeNumDimensions
in class AbstractMGAWeightRouting
public void setPositiveConstantWeights(boolean b)
b
- the value of this parameterpublic boolean getPositiveConstantWeights()
true
if the constant weights are restricted to be non-negativepublic void setPositiveTimeCoeffs(boolean b)
b
- the value of this parameterpublic boolean getPositiveTimeCoeffs()
true
if the time coefficients (for both waiting times and idle times)
are restricted to be non-negativepublic 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()
AbstractMGAWeightRouting
AbstractMGAWeightRouting.computeNumDimensions()
.initializeMean
in class AbstractMGAWeightRouting
protected double[] initializeStd()
AbstractMGAWeightRouting
AbstractMGAWeightRouting.computeNumDimensions()
.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 boolean isSolutionValid(double[] x)
isSolutionValid
in class AbstractMGAWeightRouting
x
- the solution to checkpublic double[] getConstCallWeights(double[] x)
x
- the solution vector.public double[] getConstGroupWeights(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[] getBestConstCallWeights()
public double[] getBestConstGroupWeights()
public double[] getBestCallCoeffs()
public double[] getBestGroupCoeffs()
public void exportSolution(String outputFn)
AbstractMGAWeightRouting
exportSolution
in class AbstractMGAWeightRouting
outputFn
- filename to create.