Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Variable Data Type in CPLEX Python API

    Posted 01/29/18 12:20 PM

    Originally posted by: Arun2325


    I am solving an integer linear program using Python CPLEX API. To find the type of a variable, I am using the function variables.get_types(0). In CPLEX 12.8, variable.get_types(0) returns "I" (I for integer), however CPLEX 12.6.1 returns "?". What is the reason for this? How to get the correct data type in CPLEX 12.6.1?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Variable Data Type in CPLEX Python API

    Posted 01/29/18 12:33 PM

    Which version of Python are you using with CPLEX 12.6.1? Is it Python 3.4? Do you get the same results if you use Python 2.7 with CPLEX 12.6.1? If memory serves me right, I believe there was an issue involving encoding that was fixed in a subsequent release (recall that with Python 3, raw strings are Unicode).

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Variable Data Type in CPLEX Python API

    Posted 01/29/18 01:33 PM

    Originally posted by: Arun2325


    Yes, it is working well in Python 2.7 but not in 3.4. Is there any way to make it work in 3.4 as well?


    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Variable Data Type in CPLEX Python API

    Posted 01/29/18 06:34 PM

    Unfortunately, as far as I can tell, there is no easy workaround (see APAR RS01906). The issue was fixed in the next version. Can you upgrade to at least 12.6.2?

     


    #CPLEXOptimizers
    #DecisionOptimization