From 2e5573d3334076e7e3a4b3840248d8b904fe2ac3 Mon Sep 17 00:00:00 2001 From: Xavier Nodet Date: Fri, 12 Jul 2019 19:14:40 +0200 Subject: [PATCH] Turn pattern values to int The values of the solution of the sub-problems reprensent numbers of cuts of each type of item in a roll. They are thus integers. So actually turn them into integer values so that they appear as such in the display. --- examples/mp/workflow/cutstock.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/mp/workflow/cutstock.py b/examples/mp/workflow/cutstock.py index 4294627..2784299 100644 --- a/examples/mp/workflow/cutstock.py +++ b/examples/mp/workflow/cutstock.py @@ -237,7 +237,7 @@ def cutstock_solve(item_table, pattern_table, fill_table, roll_width, **kwargs): print('{}> pattern-generator model stops, obj={:g}'.format(loop_count, rc_cost)) break - use_values = gen_model.solution.get_values(gen_model.use_vars) + use_values = [int(round(v)) for v in gen_model.solution.get_values(gen_model.use_vars)] if verbose: print('{}> add new pattern to master data: {}'.format(loop_count, str(use_values))) # make a new pattern with use values