Originally posted by: SystemAdmin
[jasonhe said:]
Thank you very much for your reply.
Following your code, I believe it will be much similar in .NET. But one more thing, since I have 3 dimensions, in the loop, you are using indices "i" and "t" and your script is:
double solValue = commandesMap.getSub(i+1).get(t+1);
In my case should it be
x.getSub(i+1).get(j+1).get(k+1) or x.getSub(i+1).getSub(j+1).get(k+1)
Merci beaucoup
[quote author=
dgravot@noos.fr link=topic=197.msg507#msg507 date=1205873374]
Sorry to write the answer with JAVA cause I'm not that familiar with the .NET API, but I assume the logic is exactly the same.
You can access to your decision variable both as a IntVarMap in the model and as a IloNumMap once the solution has been computed
Here in my model, I have declared :
dvar float+ Commande[Items,Periodes];
Now, in my JAVA code, I wrote the following to access all solution values for these variables as following :
IloNumMap commandesMap = opl.getElement("Commande").asNumMap();
for(int i=0;i<params.getNbItems();i++)<br /> {
for(int t=0;t<params.getNbPeriodes();t++)<br /> {
double solValue = commandesMap.getSub(i+1).get(t+1);
log.info("at item "+(i+1)+" periode "+(t+1)+" : "+solValue );
}
}
Hope this helps
David Gravot
ROSTUDEL - Recherche Opérationnelle, Etudes et Développement
57, rue d'Alleray 75015 Paris - France
(33)1 45 31 19 06 / (33) 6 13 46 07 63
dgravot@rostudel.comwww.rostudel.com #DecisionOptimization#OPLusingCPLEXOptimizer