Originally posted by: TalhaRashid
Hi I am new to CPLEX and am working on the below equations to be modeled:
There are a range of values of Ri, Cj and Ri* while sigma and B are constant. The issue is with the value of xj it says:
xj=
what code should I put it get this? I was thinking about an If statement but not sure. Kindly help with it. Up till now I have used the below code:
int M=...; // Set of Risks
int N=...; //Set of Mitigation Strategies
range risks=1..M;
range mitig=1..N;
float currentrisk[risks]=...;
float costmitig[mitig]=...;
float targetrisk[risks]=...;
//variables
dvar float+ R[risks][mitig];
dvar float+ x[mitig];
maximize sum(i in risks, j in mitig)R[i][j]*x[j]/currentrisk[i];
subject to {
sum(j in mitig) x[j]*costmitig[j] <= 0.7*2000000;
forall(i in risks)
currentrisk[i]-sum(j in mitig) R[i][j]*x[j] <= targetrisk[i];
forall(i in risks)
sum(j in mitig) R[i][j]*x[j] >= 0;
}
In the code currentrisk is Ri, Target risk is Ri* and costmitig is Cj. when I run it, at first it tries to install visual basic which it is unable to and then it gives me error saying: internal error please notify IBM
Kindly Help.
#CPLEXOptimizers#DecisionOptimization