Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Sum Command Gives Scripting parser error: missing ')'.

    Posted 12/13/11 12:47 PM

    Originally posted by: UMQX_Olfat_ELMahi


    Hello

    i am trying to use the some command inside execute block.
    i tried :
    int Before1;

    execute{
    Before1 = sum(i in Ap1) pKtpFrame[i];
    }

    and execute{
    Before1 = Opl.sum(i in Ap1) pKtpFrame[i];
    }

    but i gives me the following error:
    Scripting parser error: missing ')'.

    can someone help me?
    Thanks
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: Sum Command Gives Scripting parser error: missing ')'.

    Posted 12/14/11 04:29 AM
    Hi

    you should try

    int Before1 = sum(i in Ap1) pKtpFrame[i];
    


    outside of any execute block

    Regards

    Alex
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: Sum Command Gives Scripting parser error: missing ')'.

    Posted 12/14/11 10:17 AM

    Originally posted by: UMQX_Olfat_ELMahi


    Thanks for respond but my Question was not clear what i needed was to change the sum each iteration in a loop so i used something like that:

    for (var M = 1; M <noFrames ; M ++){
    for( var k1 = 0; k1 < Frameord[M]; k1++)
    Before1 = Before1 + pKtpFrame[SortFrameordk1];
    for( var k2 = 0; k2 <= Frameord[M]; k2++)
    After1 = After1 + pKtpFrame[SortFrameordk2];
    for (var N = Before1 ; N < After1; N++){
    ...
    }
    Before1 = 0;
    After1 = 0;
    }

    i thought there may be an easier way ?

    Thanks
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: Sum Command Gives Scripting parser error: missing ')'.

    Posted 12/14/11 02:17 PM

    Originally posted by: UMQX_Olfat_ELMahi


    i got the Message that
    Aggregate SUM is currently not supported for qualifier expressions.

    can some one sujest anothe solution ?

    Thanks
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: Sum Command Gives Scripting parser error: missing ')'.

    Posted 02/14/12 04:18 PM

    Originally posted by: UMQX_Olfat_ELMahi


    i calculedted the sumd in array in execution block before the constaraint block
    #DecisionOptimization
    #OPLusingCPLEXOptimizer