Hello together,
I want to use an old small source code fragment written in OPL 3 now in OPL 6 Version:
forall (t in 1..T, j in http://t+1..T : sum (i in 1..j1) m[i] < MRT){
CT0,j: s[j]>= u[0];}
int T = 192;
m[i] = interval length with 0.25
int MRT = 1;
constraint CT http://1..Thttp://0..T;
s [j] = condition
u [0] = condition
When i try to debug it, I get the error message, that agregations are not allowed in filter expressions. The Problem seems to be the "sum" and the Iteration http://.. in first line, but i'm a total beginner in that field and can't solve it.
Could anybody help? Thanks a lot for Ideas.
Topic
NOTICE: developerWorks Community will be offline May 2930, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
2 replies
Latest Post
 20130324T20:52:23Z by SystemAdmin
ACCEPTED ANSWER
Pinned topic Problem to convert OPL 3.x in OPL 6.x sorce code
20130323T13:10:35Z

Answered question
This question has been answered.
Unanswered question
This question has not been answered yet.
Updated on 20130324T20:52:23Z at 20130324T20:52:23Z by SystemAdmin

ACCEPTED ANSWER
Re: Problem to convert OPL 3.x in OPL 6.x sorce code
20130324T18:14:29Z in response to SystemAdminHi,
indeed
forall (t in 1..T, j in t+1..T : sum (i in 1..j1) m[i] < MRT)
is not allowed because aggregators like sum are not allowed in filters, but you can rewrite into
forall (t in 1..T, j in t+1..T : truthValue[j]==1)
And before the subject to block you define something like
int truthValue[j in 2..T]=(sum (i in 1..j1) m[i] < MRT)?1:0;
Regards 
ACCEPTED ANSWER
Re: Problem to convert OPL 3.x in OPL 6.x sorce code
20130324T20:52:23Z in response to SystemAdminWONDERFULL :) I thank you sincerely for your fast and perfect help. It works without any problems!