Originally posted by: SystemAdmin
[niharika said:]
HI
I have resolved the memory issue by increasing my system RAM.
my program runs and gives output for around 3365 decision variables but when i do sensitivity analysis using "getObjSA()", i get an IloException.
besides when i checked IloCPlex class there were 3/4 definitions for the getObjSA with different number or ytpes of arguments. but my program accepts only one form of the function with 3 arguments (IloNumArray lower, IloNumArray upper, IloNumVarArray X)
here is my ilog code
// constraint (1)
for ( j = 1; j < nbNodes; j++ ) {<br /> IloExpr c1(env);
for ( i = 0; i < nbNodes; i++ )<br /> if(arc[i][j]!=0)
c1 += arc[i][j]*X[i][j];
//cout<<c1; <br /> model.add(c1 <= 1);<br /> c1.end();
}
cout<<"constraint 1......."<<endl;<br /> // constraint (2)
for ( i = 0; i < nbNodes; i++ ) <br /> {
IloExpr c2(env);
for ( j = 0; j < nbNodes; j++ )<br /> if(arc[i][j]!=0)
c2 += X[i][j];
model.add(c2 >= N[i]);
}
cout<<"constraint 2......."<<endl;<br /> // constraint (3)
IloExpr c3(env);
for (i=0; i< nbNodes; i++)<br /> c3 += N[i];
model.add(c3 == k);
IloExpr objExpr(env);
for(i=0;i<nbNodes; i++)<br /> objExpr += node_wt[i]*N[i];
IloObjective obj = IloMaximize(env, objExpr);
model.add(obj);
objExpr.end();
cout<<"model formed .. start solving.............."<<endl;<br />
IloCplex cplex(env);
cplex.extract(model);
//cplex.exportModel("C:\\model1.lp");
cplex.solve();
cplex.getObjSA(lower,upper,N); cerr<<"here...cause of exception"<<endl;<br /> cout<<"problem solved .......prepare solution...."<<endl;<br /> IloSolution sol(env);
sol.add(obj);
sol.setValue(obj, cplex.getObjValue());
for ( i = 0; i < nbNodes; i++ ) <br /> {
sol.add(N[i]);
sol.setValue(N[i],cplex.getValue(N[i]));
}
cplex.getObjSA(lower,upper,N); cerr<<"here...cause of exception"<<endl;
#CPLEXOptimizers#DecisionOptimization