Class DefaultCumulatives
java.lang.Object
org.btrplace.scheduler.choco.view.AbstractCumulatives
org.btrplace.scheduler.choco.view.DefaultCumulatives
- All Implemented Interfaces:
Injectable
,MisplacedVMsEstimator
,ChocoView
,Cumulatives
public class DefaultCumulatives extends AbstractCumulatives implements Cumulatives
Builder to create a unique slices scheduler that aggregates
different resources.
- Author:
- Fabien Hermenier
-
Field Summary
Fields inherited from class org.btrplace.scheduler.choco.view.AbstractCumulatives
associations, cEnds, cHosts, cUsages, dHosts, dStarts, dUsages, non
-
Constructor Summary
Constructors Constructor Description DefaultCumulatives()
-
Method Summary
Modifier and Type Method Description void
addDim(List<org.chocosolver.solver.variables.IntVar> c, int[] cUse, org.chocosolver.solver.variables.IntVar[] dUse)
Add a dimension.boolean
beforeSolve(ReconfigurationProblem rp)
Build the constraint.boolean
inject(Parameters ps, ReconfigurationProblem rp)
Inject the constraint into the problem.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.btrplace.scheduler.choco.view.ChocoView
cloneVM, getDependencies, getMisPlacedVMs, insertActions
-
Constructor Details
-
DefaultCumulatives
public DefaultCumulatives()
-
-
Method Details
-
inject
Description copied from interface:Injectable
Inject the constraint into the problem.- Specified by:
inject
in interfaceInjectable
- Overrides:
inject
in classAbstractCumulatives
- Parameters:
ps
- the scheduler parametersrp
- the problem- Returns:
true
if the injection succeeded,false
if the problem is sure to not have a solution- Throws:
SchedulerException
- if an error occurred while injecting.
-
addDim
public void addDim(List<org.chocosolver.solver.variables.IntVar> c, int[] cUse, org.chocosolver.solver.variables.IntVar[] dUse)Add a dimension.- Specified by:
addDim
in interfaceCumulatives
- Parameters:
c
- the resource capacity of each of the nodescUse
- the resource usage of each of the cSlicesdUse
- the resource usage of each of the dSlices
-
beforeSolve
Build the constraint.- Specified by:
beforeSolve
in interfaceChocoView
- Parameters:
rp
- the problem we solve- Returns:
- the resulting constraint
-