Hi, I have developed a C++ code for my research problem (inventory-transportation problem) to run Ilog Cplex using concert technology and have successfully run it. While developing code, I have used some decision expressions like holding_cost, trans_cost, etc. to represent the objective function IloMinimize. Now the cplex.getObjvalue is giving me the value of the total cost, and it is obvious. I'm interested in knowing the individual cost components, that is, the value of each decision expression used. Can anybody tell me how to retrieve these values. Any syntax/way to do it? Thanks in advance.

asked 28 Aug '15, 10:31

Ajinkya's gravatar image

accept rate: 0%

Take a look at IloCplex::getValue. One of the overloads takes an IloNumExprArg as its first argument (and an optional IloInt as its second argument, to signal which solution in the solution pool to use). If holding_cost etc.are expressed as a subclass of IloNumExprArg (most likely IloNumExpr), this might be what you're looking for.


answered 28 Aug '15, 16:11

Paul%20Rubin's gravatar image

Paul Rubin ♦♦
accept rate: 19%

Dear Paul, It worked. Thanks a lot. Warm regards, Ajinkya.

(29 Aug '15, 03:20) Ajinkya
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 28 Aug '15, 10:31

Seen: 1,426 times

Last updated: 29 Aug '15, 03:20

OR-Exchange! Your site for questions, answers, and announcements about operations research.