From 9e15af978ee9cacac77f16ce6e70bbbf848e2d66 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Wed, 14 Sep 2022 09:18:08 +0200 Subject: [PATCH] linear_solver: bump bin_packing_mip.py --- ortools/linear_solver/samples/bin_packing_mip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ortools/linear_solver/samples/bin_packing_mip.py b/ortools/linear_solver/samples/bin_packing_mip.py index 9ed982ec8e..ae93acf751 100755 --- a/ortools/linear_solver/samples/bin_packing_mip.py +++ b/ortools/linear_solver/samples/bin_packing_mip.py @@ -86,7 +86,7 @@ def main(): # [START print_solution] if status == pywraplp.Solver.OPTIMAL: - num_bins = 0. + num_bins = 0 for j in data['bins']: if y[j].solution_value() == 1: bin_items = [] @@ -95,7 +95,7 @@ def main(): if x[i, j].solution_value() > 0: bin_items.append(i) bin_weight += data['weights'][i] - if bin_weight > 0: + if bin_items: num_bins += 1 print('Bin number', j) print(' Items packed:', bin_items)