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);
}