Originally posted by: Twister
Hi,
I am new to using OPL so I am having trouble formulating a few things. I have two variable called x and y. x is an integer array in the range of 1..20 while y is a float. I want y to be the cumulative sum of x for each corresponding index. So for example I want y[1]=0, y[2]=0.5*(x[1]), y[3]=0.5*(x[1]+x[2]), y[4]=0.5*(x[1]+x[2]+x[3]) and so on. Since y is a float I cannot express this as a constraint. It has to be done as a dexpr but I have no idea how to do this using dexpr since I think you cannot use for loop with dexpr. Any help would be very much appreciated.
Thanks in advance.
#DecisionOptimization#OPLusingCPOptimizer