Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
Expand all | Collapse all

C++ Code and meaningful variable names (or something similar)

  • 1.  C++ Code and meaningful variable names (or something similar)

    Posted Tue July 30, 2013 02:37 PM

    Originally posted by: SGrogan


    Hello all,

     

    I was talking around the office and learned tha when I export a *.lp file of my CPLEX model I can allow the program to set meaningful names to the decision variables and constraints (i.e. insetad of  "id567-id521 <=0", it would say "x{1,2}-x{1,3}<=0"  the same with constraints, such as MaterialA and MaterialB instead of id1155).  I hope this will allow for me to be able to fin errors in my formulaton faster. 

    some googling and I found setName() in the Java API, but i'm using C++ and haven't been able to confirm or deny the existance of setName()  (or something similar) in C++.  any assitance on finding the appropriate functions would be appreciated.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: C++ Code and meaningful variable names (or something similar)

    Posted Tue July 30, 2013 03:01 PM

    IloNumVar and IloConstraint both inherit from IloExtractable which has a ::setName() member.

    There also is IloExtractableArray::setNames() to set the names on an array of variables/constraints.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: C++ Code and meaningful variable names (or something similar)

    Posted Tue July 30, 2013 03:59 PM

    Originally posted by: SGrogan


    Thank you good sir:

    Just to round out the answer for any future searchers, this article I found helped me make my variable names:

    http://www-01.ibm.com/support/docview.wss?uid=swg21399995

    thanks again for your quick answer!

     

     


    #CPLEXOptimizers
    #DecisionOptimization