public abstract class AbstractLocalSearchStoch extends Object implements LocalSearchStoch
Modifier and Type | Field and Description |
---|---|
protected StochSolution |
bestSolution
The stochastic bestSolution.
|
protected int |
currPeriod
The period to optimize.
|
protected int |
numCPU
The number of CPUs to execute in parallel.
|
protected int |
numGroups
The number of agent groups.
|
protected int |
numScenarios
The number of scenarios.
|
protected int |
numTypes
The number of call types.
|
protected double[] |
rMinusCost
The recourse cost for removing one agent, per group.
|
protected double[] |
rPlusCost
The recourse cost for adding one agent, per group.
|
protected ScenariosParams |
scenParams
The scenario parameters.
|
protected List<? extends CallCenterSim> |
simList
The list of simulator, for each scenario.
|
protected List<SimParams> |
simpList
The list of simulator parameters, for each scenario.
|
protected double[] |
staffCost
The cost per agent for each group, for non-recourse variables.
|
protected boolean |
verbose
Sets to
true to print program output to screen. |
Constructor and Description |
---|
AbstractLocalSearchStoch(ScenariosParams scenParams,
double[] staffCost,
List<? extends CallCenterSim> simList)
Initializes the basic field variables of the local search.
|
AbstractLocalSearchStoch(ScenariosParams scenParams,
List<SimParams> simpList,
double[] staffCost)
Initializes the basic field variables of the local search.
|
Modifier and Type | Method and Description |
---|---|
StochSolution |
getBestSolution()
Returns the best stochastic solution found,
or
null if the local search has not been executed yet. |
int |
getNumCPU()
Returns the number of optimization threads to run in parallel.
|
boolean |
getVerbose()
Returns the value of the verbose parameter.
|
abstract StochSolution |
optimize(StochSolution initSol,
int maxIt,
int maxCPUSec)
Executes the local search starting from the given initial stochastic solution.
|
void |
setNumCPU(int n)
Sets the number of local search optimization threads to run in parallel.
|
void |
setVerbose(boolean verbose)
Sets verbose to
true to print program output to screen, else
sets to false to print less information. |
protected void |
verbosePrint(String s)
Calls the method
System.out.print(s) , where s is the argument,
if the verbose parameter 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 is set to true . |
protected StochSolution bestSolution
protected int numCPU
protected final int numGroups
protected final int currPeriod
RepSimParams
, then this
value must be 0.protected final int numScenarios
protected final int numTypes
protected double[] rMinusCost
protected double[] rPlusCost
protected final ScenariosParams scenParams
protected final List<? extends CallCenterSim> simList
protected final List<SimParams> simpList
protected double[] staffCost
protected boolean verbose
true
to print program output to screen.public AbstractLocalSearchStoch(ScenariosParams scenParams, List<SimParams> simpList, double[] staffCost)
scenParams
- the scenario parameterssimpList
- the simulation parametersstaffCost
- the staffing cost per agent per group (non-recourse variables)public AbstractLocalSearchStoch(ScenariosParams scenParams, double[] staffCost, List<? extends CallCenterSim> simList)
scenParams
- the scenario parametersstaffCost
- the staffing cost per agent per group (non-recourse variables)simList
- the list of simulators, one for each scenariopublic StochSolution getBestSolution()
null
if the local search has not been executed yet.getBestSolution
in interface LocalSearchStoch
public int getNumCPU()
getNumCPU
in interface LocalSearchStoch
public abstract StochSolution optimize(StochSolution initSol, int maxIt, int maxCPUSec)
LocalSearchStoch
LocalSearchStoch.setNumCPU(int)
.optimize
in interface LocalSearchStoch
initSol
- the initial stochastic solutionmaxIt
- the maximum number of iterations for each local search executionmaxCPUSec
- the maximum CPU time in secondspublic void setNumCPU(int n)
setNumCPU
in interface LocalSearchStoch
n
- the number of threads to run in parallelpublic void setVerbose(boolean verbose)
LocalSearchStoch
true
to print program output to screen, else
sets to false
to print less information.setVerbose
in interface LocalSearchStoch
verbose
- true
to print program output to screen, else
false
to print less information.public boolean getVerbose()
LocalSearchStoch
getVerbose
in interface LocalSearchStoch
protected void verbosePrint(String s)
System.out.print(s)
, where s
is the argument,
if the verbose parameter is set to true
.s
- the string to printprotected void verbosePrintln(String s)
System.out.println(s)
, where s
is the argument,
if the verbose parameter is set to true
.s
- the string to print