Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  For Loop

    Posted 03/31/17 07:07 AM

    Originally posted by: mGlass


    Hello everyone,

    Although I'm following the manual when building the for loop, I'm facing these errors. I've tried different other ways but haven't yet managed to do it.

    Can you help?

     

    Thank you in advance!


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: For Loop

    Posted 03/31/17 07:37 AM

    Hi,

    "for" needs to be in an execute block

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: For Loop

    Posted 03/31/17 08:01 AM

    Originally posted by: mGlass


    Hi,

     

    First of all thank you!

    The problem is that then I have a "Type Scripting parser error: missing expression"


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: For Loop

    Posted 03/31/17 08:06 AM

    Hi,

    can you post your model so that other users could try to help you ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: For Loop

    Posted 03/31/17 09:23 AM

    Originally posted by: mGlass


    Here it is!

     


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 6.  Re: For Loop

    Posted 03/31/17 10:12 AM

    Hi,

    instead of

    execute{
    for (var i = 1;i <= nclients;i++){
        for(var p = 1; p <= npallets; [p++]) {
           stockinclient[i][p][0] == c_initialstock[i][p];
    }
    }

    for (var j = 1;j <= nplants;j++){
        for(var p = 1; p <= npallets; [p++]) {
           stockinplant[j][p][0] == p_initialstock[i][p];
    }
    }
    }

    can you write

    execute{
    for (var i = 1;i <= nclients;i++){
        for(var p = 1; p <= npallets; p++) {
           stockinclient[i][p][0] == c_initialstock[i][p];
    }
    }

    for (var j = 1;j <= nplants;j++){
        for(var p = 1; p <= npallets; p++) {
           stockinplant[j][p][0] == p_initialstock[i][p];
    }
    }
    }

     

    ?

    regards


    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 7.  Re: For Loop

    Posted 03/31/17 10:16 AM

    Originally posted by: mGlass


    yes, thank you very much!


    #DecisionOptimization
    #OPLusingCPLEXOptimizer