Code Block Test
from gurobipy import *
def mycallback(model, where):
if where == GRB.Callback.MIPSOL:
# Adding some lazy constraints
pass
# The number of threads, 48 or 32
Threads = 48
m = read('model.lp')
# Set the number of threads
m.setParam("Threads", Threads)
# Set LazyConstraints = 1
m.setParam("LazyConstraints", 1)
m.optimize(mycallback)
if m.Status == 2:
print("Find Solution")
m.write('solution_%i_cores.sol' %Threads)
elif m.Status == 3:
print("the model is infeasible")
else:
print("Unkown Error")
0
-
body { overflow: hidden; background: #000000; background-image: url(images/bg.gif); background-repeat: no-repeat; background-position: left top; }
0
კომენტარის დასატოვებლად გთხოვთ გაიაროთ ავტორიზაცია.
კომენტარები
1 comment