简体   繁体   中英

Enforce no-delay schedule IBM OPL (CPLEX)

I created a schedule in 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. 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.

Anyone who can give me a hint on how to solve this problem?

Kind regards, Franz

you should try to use endAtStart. (OPL constraint to restrict the relative positions of interval variables.) regards

endAtStart will only work if your Jobs are always ready to start when the preceding Job finishes. 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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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