Originally posted by: SumanL
Hello Alex,
Thank you for your reply.
I changed dexpr to dvar.But i have two errors "Constraint could not be created" and " Exception from IBM ILOG Concert: Bad Conversion between an integer object and a numeric object".
In the below code, I am initializing the first column of ar to either one or zero depending on the condition given. Then the rest are assigned according to the equation.
xr is my main decision variable which is of type boolean.
ub is another 2 dimensional int expression which is a function of xr.
ar is a float datatype and a function or ub, xr and previous values of ar
subject to
{
forall(i in r,j in t:((((i mod ftoi(row/bank)) == 1) ) && (j == 1))) /// initialize some of the elements in the first column of ar to 1
ar[i][j]== 1;
forall(i in r,j in t:((((i mod ftoi(row/bank)) != 1) ) && (j == 1))) /// initialize remaining elements in the first column of ar to 0
ar[i][j]== 0;
forall(i in r,j in t:(j!=1)) /// rest of the columns of ar are calculated using the values of the previous columns of ar
ar[i][j]== (abs(ar[i][j-1]-ub[ftoi(i/row)][j]) + (ar[i][j-1] - ub[ftoi(i/row)][j]))/2.0 + xr[i][j];
}
#DecisionOptimization#OPLusingCPLEXOptimizer