Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Error message "Scripting runtime error: cannot convert to an integer, "2777734350"."

    Posted 09/26/13 06:55 AM

    Originally posted by: Calvin Sun Hainan


    I have an error message in my OPL script "Scripting runtime error: cannot convert to an integer, "2777734350"."

    This is strange as OPL script should have no problem to handle a big integer value up to 9e+15 based on my previous understanding.

    The only possible cause I can think about is the data type "var" not allow values as big as 2777734350.

    In my script, I have some calculation like this.

    int x = 2780000000;

    execute {

                 var a;

                 ......

                  x -= a;

    }

    It looks like OPL script tries to convert the variable "a" from "var" to "int" to do the calculation for "x". However, that fails for some reason.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Error message "Scripting runtime error: cannot convert to an integer, "2777734350"."

    Posted 09/26/13 08:10 AM

    Hi,

     

    the integer values you can use in scripting are limited to pow(2,31)-1

     

    So for example

     

    int x=ftoi(pow(2,31)-1);
    int x2=x+1000;
     

    execute {
    x=x-1;   // works fine
    x2=x2-1; // does not work
             
               

    }

     

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Error message "Scripting runtime error: cannot convert to an integer, "2777734350"."

    Posted 09/26/13 09:09 PM

    Originally posted by: Calvin Sun Hainan


    Thanks. I will change my variable type to float. That should fix the problem.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Error message "Scripting runtime error: cannot convert to an integer, "2777734350"."

    Posted 10/27/16 07:01 AM

    Originally posted by: CPlex_NooBie


    Hi Alex,

     

    What should I do if I have to use "ftoi" with the execute block?
    Is there any other function for it?


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Error message "Scripting runtime error: cannot convert to an integer, "2777734350"."

    Posted 10/27/16 07:07 AM

    Hi,

    you may use "Opl." in execute blocks:

    float f=12000.0;
    int x=ftoi(f);

    int x2=0;
    execute
    {
    x2=Opl.ftoi(f);
    }
     
     assert x==x2;

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: Error message "Scripting runtime error: cannot convert to an integer, "2777734350"."

    Posted 10/27/16 10:38 AM

    Originally posted by: CPlex_NooBie


    Thanks, Alex!

    It worked! 


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: Error message "Scripting runtime error: cannot convert to an integer, "2777734350"."

    Posted 02/12/14 07:27 AM

    Originally posted by: Rajasekhar Kadambur


    I am using lamda values for solving multi-objective problem of order 43!(factorial) and the results is showing this error. will you explain this how to overcome this error.

     

    Warning:  Bound infeasibility column 'id32'.
    Warning:  Bound infeasibility column 'id32'.
    Warning:  -Infinity upper bound ignored.


    #DecisionOptimization
    #OPLusingCPLEXOptimizer