[英]CPLEX Python API how to multiply a decision variable with a dummy in the objective function?
[英]Is possible to change the decision variable type for cplex in python?
(1) 當我在 python 中為 cplex 定義決策變量時,
x = np.empty((6,1), dtype= object)
for i in range(6):
x[i] = mdl.integer_var(lb= 0, ub= inf, name='x' + str(i+1))
如何將 x 的決策變量類型從 integer_var 更改為 integer_var_list?
(2) 當我如下定義決策變量時。
x = mdl.integer_var_list(6, 0, inf, name='x')
x 的大小為 (6, )。 對於 (6,1) 的大小,如何將 x 定義為 integer_var_list ?
先感謝您。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.