public class RoutOptWeightRouting extends Object implements MultiDimNumFunction, RunTimeLimit
Note : all the parameters are unbounded by default.
The number of dimensions of the problem is the sum of size of the skillset of all agent groups times 3.
Modifier and Type | Class and Description |
---|---|
static class |
RoutOptWeightRouting.Results
Represents the class object of the weight routing solution.
|
Constructor and Description |
---|
RoutOptWeightRouting(CallCenterSim sim,
RoutingObjectiveFunc objFunc) |
Modifier and Type | Method and Description |
---|---|
double |
eval(double[] x)
Evaluates the multi-dimension function.
|
void |
exportSolution(String outputFn) |
double[][] |
getBestCallCoeffs()
Get the callCoeffsTG matrix for the best solution found.
|
double[][] |
getBestConstWeights()
Get the constWeightsTG matrix for the best solution found.
|
double[][] |
getBestGroupCoeffs()
Get the groupCoeffsGT matrix for the best solution found.
|
RoutOptWeightRouting.Results |
getBestResults()
Return the best results of the last optimization run.
|
double |
getBestScore()
Get the score of the best solution found.
|
double |
getCallCoeffsMult()
Get the call coefficients multiplier used when simulating a solution.
|
GradientDescentWeightRouting |
getGradientDescentWeightRouting()
Get the gradient descent object that is used for optimization.
|
double |
getGroupCoeffsMult()
Get the group coefficients multiplier used when simulating a solution.
|
int |
getLastRunTimeSec()
Calls the function
FiniteGradientDescent.getLastRunTimeSec() . |
boolean |
getManualRelocationAll()
Decide if the manual relocation method will try to relocate every variables
(constant weights and coefficients) if true.
|
double[] |
getMaxBounds()
Get the maximum bounds that will be used in the gradient descent search.
|
double[] |
getMinBounds()
Get the minimum bounds that will be used in the gradient descent search.
|
int |
getNumDimensions()
Return the number of dimensions of this function, must have the same
dimension as for
MultiDimNumFunction.eval(double[]) . |
int |
getTimeLimitSec()
Calls the function
FiniteGradientDescent.getTimeLimitSec() . |
void |
init() |
static void |
main(String[] args) |
double |
optimize()
Execute the gradient descent optimization with the
given constant weights, call waiting coefficients and group idle time
coefficients parameters as the initial solution.
|
double |
optimize(double[] initVector)
Execute the gradient descent optimization.
|
void |
setCallCoeffsMult(double d)
Set the call coeffs matrix multiplier.
|
void |
setGradientDescentBounds(double[] maxBounds,
double[] minBounds)
The user can define the maximum and minimum bounds if he does not want to
use the automatic bounds (unlimited bounds for constant weights and an
interval of
[0,∞[ for call waiting time coefficients and
group idle time coefficients.
|
void |
setGradientDescentWeightRouting(GradientDescentWeightRouting fgd)
Set the gradient descent object to use for optimization.
|
void |
setGroupCoeffsMult(double d)
Set the group coeffs matrix multiplier.
|
void |
setManualRelocationAll(boolean b)
Decide if the manual relocation method will try to relocate every variables
(constant weights and coefficients) if true.
|
void |
setTimeLimitSec(int sec)
Calls the function
FiniteGradientDescent.setTimeLimitSec(int) . |
public RoutOptWeightRouting(CallCenterSim sim, RoutingObjectiveFunc objFunc)
public void init()
public void setGradientDescentWeightRouting(GradientDescentWeightRouting fgd)
fgd
- the gradient descent object to use for optimization.public GradientDescentWeightRouting getGradientDescentWeightRouting()
public void setGradientDescentBounds(double[] maxBounds, double[] minBounds)
maxBounds
- the maximum bounds.minBounds
- the minimum bounds.public double[] getMaxBounds()
public double[] getMinBounds()
public void setCallCoeffsMult(double d)
d
- the call coefficients multiplier.public double getCallCoeffsMult()
public void setGroupCoeffsMult(double d)
d
- the group coefficients multiplier.public double getGroupCoeffsMult()
public void setManualRelocationAll(boolean b)
b
- set to true to relocate all variables, or false for only
the constant weights.public boolean getManualRelocationAll()
public void setTimeLimitSec(int sec)
FiniteGradientDescent.setTimeLimitSec(int)
.setTimeLimitSec
in interface RunTimeLimit
sec
- the time limit in seconds.public int getTimeLimitSec()
FiniteGradientDescent.getTimeLimitSec()
.getTimeLimitSec
in interface RunTimeLimit
public int getLastRunTimeSec()
FiniteGradientDescent.getLastRunTimeSec()
.getLastRunTimeSec
in interface RunTimeLimit
public double optimize()
public double optimize(double[] initVector)
initVector
- the initial vector solution to use. The vector is of size
sum of skillsets times 3, in the order of the constant weights, call waiting coefficients
and group idle time coefficients matrices. The index order
are determined by reading the canServeGT matrix with a double for loop.
The program reads the call type as the outer loop
and the group as the inner loop (the result is that each call type is grouped together).public int getNumDimensions()
MultiDimNumFunction
MultiDimNumFunction.eval(double[])
.getNumDimensions
in interface MultiDimNumFunction
public double eval(double[] x)
MultiDimNumFunction
eval
in interface MultiDimNumFunction
x
- The array of variables of the function.public RoutOptWeightRouting.Results getBestResults()
public double[][] getBestConstWeights()
public double[][] getBestCallCoeffs()
public double[][] getBestGroupCoeffs()
public double getBestScore()
public void exportSolution(String outputFn)