简体   繁体   English

如何使用 CPLEX opl 添加这样的约束?

[英]How to add a constraint like this with CPLEX opl?

S[i][j][k] is the starting time of operation O[i][j] on machine[k]. S[i][j][k] 是机器[k] 上操作 O[i][j] 的开始时间。

C[i][j][k] completion time of operation O[i][j] on machine[k]. C[i][j][k] 在机器[k] 上操作 O[i][j] 的完成时间。

v[i][j][k] equals 1 if operation O[i][j] performs on machine[k], otherwise 0.如果操作 O[i][j] 在 machine[k] 上执行,则 v[i][j][k] 等于 1,否则为 0。

I want to add constraint that S[i][j][k]+C[i][j][k]<=v[i][j][k]*Big-M, where k belongs to MC[i][j]我想添加约束 S[i][j][k]+C[i][j][k]<=v[i][j][k]*Big-M,其中 k 属于 MC[我][j]

MC[i][j] is the candidate machine set that can process operation O[i][j]. MC[i][j] 是可以处理操作 O[i][j] 的候选机器集。

Can anyone help to formulate this problem?任何人都可以帮助制定这个问题吗?

I am new to CPLEX, and I don't know how to add a constraint like this(because k has some constraint that k should belongs to MC[i][j])我是 CPLEX 的新手,我不知道如何添加这样的约束(因为 k 有一些约束 k 应该属于 MC[i][j])

In OPL you can write this sort of constraint almost as if it were natural language:在 OPL 中,您几乎可以像编写自然语言一样编写这种约束:

float bigM = ...; // Put some value for bigM
forall (i in I)
  forall (j in J)
    forall (k in MC[i][j])
      S[i][j][k] + S[i][j][k] <= v[i][j][k] * bigM;

Note that there seems to be a problem in your description: S[i][j][k] specifies both the starting and completion time of a job.请注意,您的描述中似乎存在问题: S[i][j][k] 指定了作业的开始时间完成时间。 That is most likely not what you want.这很可能不是你想要的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM