Hi ,all I want to create a constraint in OPL.I don't know how to ?
I want to create a constraint
Could you help me? Thanks all.
This question is marked "community wiki".

Hi You may also use a constraint on a cumulative function, such as in the following example. We have for each interval a function that is 1 from the start of the interval to the infinity of time. Summing these functions over the interval will give you a cumul function that represents ay any time points the number of intervals that starts before this time point. What you have to enforce is that at any time points 0 to 6 (6 excluded), this function cannot take values higher than 10. This is done through the function
answered 21 Mar '14, 11:18 David I'm sorry,I never use this function, Could you tell me how to use this funciton to my problem? thank you!
(24 Mar '14, 21:14)
spzcwg
1
I advise you to read the documentation concerning interval scheduling and cumulative functions. These concepts are high level abstractions, very powerful to model complex constraints. These global expressions and constraints usually propagate better with intervals (it would be interesting for you to compare number of fails and branches with both implementations)
(25 Mar '14, 07:45)
David
And they are more efficient than explicitely stating the constraint with logical expressions as in fbahr response.
(26 Mar '14, 05:01)
jfpuget
1
Thanks all,I have solved this problem with cumulFunction function. Yes,I find it is powerful! Thans a lot!
(03 Apr '14, 03:04)
spzcwg

Your constraint can easily be formulated using the logical implication operator (
However: while, IINM, logical implications are also allowed in CPLEX OPL models, the answered 13 Mar '14, 07:15 fbahr ♦ Thanks for your help,It works well.
(17 Mar '14, 03:48)
spzcwg
The cumulative function proposed by David does what fbahr proposes, albeit in a more efficient way.
(26 Mar '14, 04:59)
jfpuget
