remove OptionalIntVar from the sat Python API

This commit is contained in:
Laurent Perron
2018-08-31 16:56:55 +02:00
parent 93d7d6f566
commit 651e44cf0a
4 changed files with 17 additions and 73 deletions

View File

@@ -136,10 +136,8 @@ def SolveRcpsp(problem, proto_file):
for r in all_recipes:
recipe = task.recipes[r]
is_present = model.NewBoolVar('is_present_%i_r%i' % (t, r))
start = model.NewOptionalIntVar(0, horizon, is_present,
'start_%i_r%i' % (t, r))
end = model.NewOptionalIntVar(0, horizon, is_present,
'end_%i_r%i' % (t, r))
start = model.NewIntVar(0, horizon, 'start_%i_r%i' % (t, r))
end = model.NewIntVar(0, horizon, 'end_%i_r%i' % (t, r))
interval = model.NewOptionalIntervalVar(
start, recipe.duration, end, is_present, 'interval_%i_r%i' % (t, r))