Search in sources :

Example 1 with Cumulatives

use of org.btrplace.scheduler.choco.view.Cumulatives in project scheduler by btrplace.

the class DefaultReconfigurationProblem method addContinuousResourceCapacities.

private void addContinuousResourceCapacities() {
    TIntArrayList cUse = new TIntArrayList();
    List<IntVar> iUse = new ArrayList<>();
    for (int j = 0; j < getVMs().size(); j++) {
        VMTransition a = vmActions.get(j);
        if (a.getDSlice() != null) {
            iUse.add(csp.intVar(1));
        }
        if (a.getCSlice() != null) {
            cUse.add(1);
        }
    }
    ChocoView v = getView(Cumulatives.VIEW_ID);
    if (v == null) {
        throw SchedulerModelingException.missingView(model, Cumulatives.VIEW_ID);
    }
    ((Cumulatives) v).addDim(getNbRunningVMs(), cUse.toArray(), iUse.toArray(new IntVar[iUse.size()]));
}
Also used : ChocoView(org.btrplace.scheduler.choco.view.ChocoView) AliasedCumulatives(org.btrplace.scheduler.choco.view.AliasedCumulatives) Cumulatives(org.btrplace.scheduler.choco.view.Cumulatives) TIntArrayList(gnu.trove.list.array.TIntArrayList) IntVar(org.chocosolver.solver.variables.IntVar) TIntArrayList(gnu.trove.list.array.TIntArrayList)

Aggregations

TIntArrayList (gnu.trove.list.array.TIntArrayList)1 AliasedCumulatives (org.btrplace.scheduler.choco.view.AliasedCumulatives)1 ChocoView (org.btrplace.scheduler.choco.view.ChocoView)1 Cumulatives (org.btrplace.scheduler.choco.view.Cumulatives)1 IntVar (org.chocosolver.solver.variables.IntVar)1