Search in sources :

Example 1 with Packing

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

the class DefaultReconfigurationProblem method linkCardinalityWithSlices.

private void linkCardinalityWithSlices() {
    Stream<Slice> s = vmActions.stream().map(VMTransition::getDSlice).filter(Objects::nonNull);
    IntVar[] ds = s.map(Slice::getHoster).toArray(IntVar[]::new);
    int[] usages = new int[ds.length];
    Arrays.fill(usages, 1);
    ChocoView v = getView(Packing.VIEW_ID);
    if (v == null) {
        throw SchedulerModelingException.missingView(model, Packing.VIEW_ID);
    }
    ((Packing) v).addDim("vmsOnNodes", vmsCountOnNodes, usages, ds);
}
Also used : ChocoView(org.btrplace.scheduler.choco.view.ChocoView) Packing(org.btrplace.scheduler.choco.view.Packing) IntVar(org.chocosolver.solver.variables.IntVar)

Aggregations

ChocoView (org.btrplace.scheduler.choco.view.ChocoView)1 Packing (org.btrplace.scheduler.choco.view.Packing)1 IntVar (org.chocosolver.solver.variables.IntVar)1