简体   繁体   English

实施无延迟计划 IBM OPL (CPLEX)

[英]Enforce no-delay schedule IBM OPL (CPLEX)

I created a schedule in IBM OPL:我在 IBM OPL 中创建了一个计划:

dvar sequence schedule in all(j in Jobs) job[j]; 

If the CP-Module generates a solution, the solution is sometimes not a non-delay solution.如果 CP-Module 生成解决方案,则该解决方案有时不是非延迟解决方案。 This is however not allowed and thus I want to enforce a non-delay schedule.然而,这是不允许的,因此我想强制执行非延迟时间表。

I tried different solutions in the subject to-Section...我在主题到部分尝试了不同的解决方案......

 forall(t in Jobs)
   if (t > 1)
   startOf(job[t]) == endOf(job[t-1]);

... but these fail (obviously) when job t-1 is not followed by job t. ...但是当工作 t-1 后面没有工作 t 时,这些(显然)会失败。

Anyone who can give me a hint on how to solve this problem?谁能给我一个关于如何解决这个问题的提示?

Kind regards, Franz亲切的问候,弗兰兹

you should try to use endAtStart.您应该尝试使用 endAtStart。 (OPL constraint to restrict the relative positions of interval variables.) regards (用于限制区间变量相对位置的 OPL 约束。)

endAtStart will only work if your Jobs are always ready to start when the preceding Job finishes. endAtStart仅在您的作业始终准备好在前一个作业完成时开始时才起作用。 If this is not the case, you will receive an error.如果不是这种情况,您将收到错误消息。

A better solution would be to regard the no-delay in the objective.更好的解决方案是考虑目标的无延迟。 What you are trying to achieve is to start every new job as soon as possible.你想要实现的是尽快开始每一项新工作。 So you can for example use the staticLex function:例如,您可以使用staticLex函数:

minimize staticLex(startOf(job[1]), startOf(job[2]),...);

However, this expression can become very long and you would need to hardcode the number of intervals.但是,此表达式可能会变得很长,您需要对间隔数进行硬编码。 A little workaround would be to assign the intervals decreasing weighting factors :一个小的解决方法是分配间隔减少权重因子

minimize sum(j in Jobs) startOf(job[j])*100^-ord(Jobs,j);

I hope this works for you!我希望这对你有用!

Regards Jan问候简

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

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