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

Re: Problem to convert OPL 3.x in OPL 6.x sorce code
20130324T18:14:29ZThis is the accepted answer. This is the accepted answer.Hi,
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