use of org.btrplace.scheduler.choco.extensions.pack.VectorPacking in project scheduler by btrplace.
the class VectorPackingTest method modelPack.
public void modelPack(int[][] capa, int[][] height) {
int nRes = capa.length;
assert nRes == height.length;
int nBins = capa[0].length;
int nItems = height[0].length;
s = new Model();
loads = new IntVar[nRes][nBins];
bins = new IntVar[nItems];
String[] name = new String[nRes];
for (int d = 0; d < nRes; d++) {
name[d] = "d" + d;
for (int i = 0; i < nBins; i++) {
loads[d][i] = s.intVar("l" + d + "." + i, 0, capa[d][i], true);
}
}
sizes = height;
bins = s.intVarArray("b", nItems, 0, nBins, false);
Constraint cPack = new VectorPacking(name, loads, sizes, bins);
s.post(cPack);
}
Aggregations