return value added

This commit is contained in:
Josh Burman 2022-04-19 18:41:31 +00:00
parent e3d9b2e36e
commit 0380401b2b

View File

@ -33,6 +33,7 @@ def yosh_loop():
iif_target = 0.5
tif_target = 0.9
item_vars = LpVariable.dicts("Item", Items, cat="Binary")
result = 'Infeasible'
while drift <= drift_limit:
prob = LpProblem("tif_tcc_test", LpMinimize)
@ -53,8 +54,13 @@ def yosh_loop():
else:
for v in prob.variables():
print(v.name, "=", v.varValue)
result = LpStatus[prob.status]
break
return result
def test_solver():
print(yosh_loop())
assert yosh_loop() == 'Solved'
assert yosh_loop() == 'Optimal'