Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Syntax error_using a loop

    Posted 11/16/18 09:50 AM

    Originally posted by: Margarett


    Hello! 

    There are 3 errors in the syntax of using a loop.

    I need to use a loop to populate the first column of the matrix.

    (?)  Please tell me how to write a cycle correctly.

     

    range S = 1..8;
    range P = 1..4;
    dvar int z [S, P];
    int z0 = 2;

    for (var i=1; i < 9; i++) { z[i][1]==z0 } 

     

     

    Best regards, 

    Margarett. 


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Syntax error_using a loop

    Posted 11/16/18 11:37 AM

    Hi

    range S = 1..8;
    range P = 1..4;
    dvar int z [S, P];
    int z0 = 2;

    subject to
    {
    forall (i in S)  z[i][1]==z0 ;

    works fine

    regards


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Syntax error_using a loop

    Posted 11/16/18 01:09 PM

    Originally posted by: Margarett


    AlexFleischer, Thank you very much for your help! 

     

    Best regards, 

    Margarett. 


    #CPLEXOptimizers
    #DecisionOptimization