Originally posted by: Mehrsa
Hi every one
I have started learning opl and cplex on my own, I solve 2 simple problems but on the second one, The cplex gives me the solution that it does nt satisfy the constraints. I do nt know what I am doing wrong, please help me.
int m =...;
int n =...;
int s[1..n]=...;
int d[1..n]=...;
float t[1..m][1..n]=...;
float c[1..n]=...;
dvar int+ x [1..n];
maximize
sum (j in 1..n)( x[j]+s[j]-d[j]);
subject to {
forall (i in 1..m)
sum (j in 1..n)
t[i][j] * x[j]<=c[i];
forall (j in 1..n)
d[j]-s[j]<= x[j] ;
}
m=2;
n=2;
s=[30 90];
d=[75 95];
t=[[50 24]
[30 33]
];
c=[2400 2100]
the solution is (45,6) which is not correct.
#DecisionOptimization#OPLusingCPLEXOptimizer