Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions examples/mp/callbacks/cut_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ def build_supply_model(fixed_costs, supply_costs, use_cuts=False, **kwargs):
cut_cb.add_cut_constraint(supply[c, l] <= location_used)
print('* add cut constraints callback with {0} cuts'.format(len(cut_cb.cts)))

m.cut_callback = cut_cb
m.cut_callback = cut_cb

return m


Expand Down Expand Up @@ -160,7 +161,7 @@ def build_test_supply_model(use_cuts, **kwargs):
use_cuts = True
for arg in args[1:]:
if arg == '-cuts':
use_cuts = False
use_cuts = True
elif arg == '-nocuts':
use_cuts = False
else:
Expand Down
5 changes: 3 additions & 2 deletions examples/mp/callbacks/lazy_callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ def build_supply_model(fixed_costs, supply_costs, lazy=True, **kwargs):
m.sum(supply[c, l] for c in range_clients) <= (nb_clients - 1) * used[l] for l in range_locations)
print('* added lazy constraints callback with {0} constraints'.format(len(lazyct_cb.cts)))

m.lazy_callback = lazyct_cb
m.lazy_callback = lazyct_cb

m.parameters.preprocessing.presolve = 0
return m

Expand Down Expand Up @@ -157,7 +158,7 @@ def build_test_supply_model(lazy, **kwargs):
if arg == '-lazy':
use_lazy = True
if arg == '-nolazy':
use_lazy = True
use_lazy = False
else:
print('Unknown argument %s' % arg)
random = False
Expand Down