当前位置:   article > 正文

python非线性规划问题_采用Gurobi+Python平台,非线性规划计算

非线性规划问题gurobi遗传算法代码

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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/从前慢现在也慢/article/detail/612150
推荐阅读
相关标签
  

闽ICP备14008679号