public class StochFluidStaffing extends Object
Constructor and Description |
---|
StochFluidStaffing(CallCenter cc)
Constructs and initializes a cutting plane optimizer
with no initial linear programming problem.
|
Modifier and Type | Method and Description |
---|---|
protected void |
generateScenario(int numScenario)
Generate a number of random scenarios.
|
Solver |
generateSolver()
Returns a new instance of the default Solver used by the optimizer.
|
protected int |
getHashMapFlowIndex(int type,
int group,
int scenario)
Get the variable index of the flow of call type to the agent group for the scenario.
|
protected int |
getHashMapStaffingIndex(int group)
Get the variable index from HashMap of the group.
|
protected int |
getHashMapSurplusIndex(int type,
int scenario)
Get the variable index of the surplus variable for call type and scenario.
|
protected int |
getHashMapViolationIndex(int type,
int scenario)
Get the variable index of the violation variable for call type and scenario.
|
double[][][] |
getOptimalFlowAllocation()
Return the optimal (call,group,scenario) flow allocations.
|
double |
getOptimalObjective()
Returns the objective value of the optimal staffing vector (integer number
of agents).
|
int[] |
getOptimalStaffing()
Returns the staffing solution found by the optimizer.
|
double |
getStaffingCost(int[] staffing)
Return the cost of the staffing.
|
void |
init(CallCenter cc)
Reads the call center parameters.
|
static void |
main(String[] args)
Runs the optimization with the entered parameters files.
|
void |
optimize()
Execute the optimization.
|
protected int[] |
optimizeCP()
Execute the cutting-plane optimization.
|
protected void |
printNumAgents(int[] staffing) |
protected void |
printNumAgents(int[] staffing,
boolean print) |
void |
setDefaultSolver(Class c)
Sets the default Solver to be used by the optimizer.
|
protected boolean |
setHashMapFlowIndex(int type,
int group,
int scenario,
int index)
Set the variable index of the flow for call type to agent group for the scenario.
|
protected boolean |
setHashMapStaffingIndex(int group,
int index)
Set the group variable index if not present in HashMap.
|
protected boolean |
setHashMapSurplusIndex(int type,
int scenario,
int index)
Set the variable index for the surplus variable of the call type and scenario.
|
protected boolean |
setHashMapViolationIndex(int type,
int scenario,
int index)
Set the variable index for the violation variable of the call type and scenario.
|
protected double[] |
solverSolve()
Internal use.
|
public StochFluidStaffing(CallCenter cc)
init
implicitly.cc
- the call center parameters.public static void main(String[] args) throws Exception
Exception
public Solver generateSolver()
setDefaultSolver(java.lang.Class)
.public void setDefaultSolver(Class c)
c
- the class of the new solver to be used by default.public void init(CallCenter cc)
cc
- the call center parameter.protected double[] solverSolve() throws SolverException
Solver.solve()
function of the Solver and also updates the solutions.SolverException
- if an error occurred while solving the MIP.public void optimize()
protected int[] optimizeCP()
public int[] getOptimalStaffing()
public double getOptimalObjective()
public double[][][] getOptimalFlowAllocation()
public double getStaffingCost(int[] staffing)
staffing
- find the total cost of this staffing vector.protected void printNumAgents(int[] staffing)
protected void printNumAgents(int[] staffing, boolean print)
protected int getHashMapStaffingIndex(int group)
group
- retrieve the variable index of this group.protected boolean setHashMapStaffingIndex(int group, int index)
group
- the group to insert in HashMap.index
- the variable index to be associate with this group.protected int getHashMapFlowIndex(int type, int group, int scenario)
type
- the call type.group
- the agent group.scenario
- the scenario.protected boolean setHashMapFlowIndex(int type, int group, int scenario, int index)
type
- the call type.group
- the agent group.scenario
- the scenario.index
- the variable index.protected int getHashMapViolationIndex(int type, int scenario)
type
- the call type.scenario
- the scenario.protected boolean setHashMapViolationIndex(int type, int scenario, int index)
type
- the call type.scenario
- the scenario.index
- the variable index for this violation variable.protected int getHashMapSurplusIndex(int type, int scenario)
type
- the call type.scenario
- the scenario.protected boolean setHashMapSurplusIndex(int type, int scenario, int index)
type
- the call type.scenario
- the scenario.index
- the variable index for this violation variable.protected void generateScenario(int numScenario)