reindent java code
This commit is contained in:
@@ -81,7 +81,8 @@ public class BinPackingProblem {
|
||||
// slack[b] => load[b] <= safeCapacity.
|
||||
model.addLessOrEqual(load[b], safeCapacity).onlyEnforceIf(slacks[b]);
|
||||
// not(slack[b]) => load[b] > safeCapacity.
|
||||
model.addGreaterOrEqual(load[b], safeCapacity + 1).onlyEnforceIf(slacks[b].not());
|
||||
model.addGreaterOrEqual(load[b], safeCapacity + 1)
|
||||
.onlyEnforceIf(slacks[b].not());
|
||||
}
|
||||
|
||||
// Maximize sum of slacks.
|
||||
@@ -92,7 +93,8 @@ public class BinPackingProblem {
|
||||
CpSolverStatus status = solver.solve(model);
|
||||
System.out.println("Solve status: " + status);
|
||||
if (status == CpSolverStatus.OPTIMAL) {
|
||||
System.out.printf("Optimal objective value: %f%n", solver.objectiveValue());
|
||||
System.out.printf("Optimal objective value: %f%n",
|
||||
solver.objectiveValue());
|
||||
for (int b = 0; b < numBins; ++b) {
|
||||
System.out.printf("load_%d = %d%n", b, solver.value(load[b]));
|
||||
for (int i = 0; i < numItems; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user