【问题标题】:Inequality in constraints. I am trying to write the following mathematical equation in julia , not sure how to deal with the inequality conditions约束中的不平等。我正在尝试在 julia 中编写以下数学方程式,不知道如何处理不等式条件
【发布时间】:2018-02-25 16:31:56
【问题描述】:

我现在有以下代码。请有人帮助如何在循环中实现不等式条件?谢谢

for i=1:c
    for j=1:c
        for k=1:N_+
@constraint(m,2*y[i,j,k]- sum{x[h,i],h=0:N_0}- sum{x[l,k],l=1:c} <=0)   
        end
    end
end

【问题讨论】:

    标签: julia gurobi julia-jump


    【解决方案1】:
    for i=1:c
        for j=1:c
           if j!=i
            for k=1:N_+
    @constraint(m,2*y[i,j,k]- sum{x[h,i] for h=0:N_0 if h!=i}- sum{x[l,k] for l=1:c if l !=k} <=0)   
            end
          end
        end
    end
    

    【讨论】:

      猜你喜欢
      • 2022-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-11
      相关资源
      最近更新 更多