赞
踩
from gurobipy import *
def HFS_Model_MS(nJ, M, P):
print('MS')
# model
m = Model()
X = {}
Y = {}
T = {}
C = {}
CS = {}
S = {}
bigM = {}
ms = {}
# paramters
Mi = [[], [], [], []]
nI = len(M)
nL = len(P[1])
bigM = 100000
it = 0
for i in range(nI):
for j in range(M[i]):
Mi[i].append(it)
it = it + 1
# variables
for j in range(nJ):
for k in range(nJ):
X[(j, k)] = m.addVar(vtype=GRB.BINARY, name="X%d,%d" % (j, k))
for i in range(nI):
for k in range(nJ):
for l in range(nL):
Y[(i, k, l)] = m.addVar(vtype=GRB.BINARY, name="Y%d,%d,%d" % (i, k, l))
for j in range(nJ):
f
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。