Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  what is wrong with my opl code?

    Posted 09/22/08 07:06 PM

    Originally posted by: SystemAdmin


    [T.B. said:]

    Dear all,

    My OPL is an old verson --OPL3.7.  When I ran the code, OPL indicated that the line in red in the code had some mistake, and the error

    message is in the  following:

    [color=blue][u]E:\Study\ILog\linebalance.mod(28) : semantic error: identifier 'k' has not been declared[/u][/color]

    range jobs 1..11;
    range stations 1..4;
    int priority[jobs,jobs]=[
      [0,1,0,0,0,0,0,0,0,0,0],
      [0,0,1,0,0,0,0,0,0,0,0],
      [0,0,0,0,0,1,1,0,0,0,0],
      [0,0,0,0,1,0,0,0,0,0,0],
      [0,0,0,0,0,0,0,1,1,0,0],
      [0,0,0,0,0,0,0,0,0,1,0],
      [0,0,0,0,0,0,0,0,0,1,0],
      [0,0,0,0,0,0,0,0,0,1,0],
      [0,0,0,0,0,0,0,0,0,1,0],
      [0,0,0,0,0,0,0,0,0,0,1],
      [0,0,0,0,0,0,0,0,0,0,0]];
     
    int time[jobs]=[45,11,9,50,15,12,12,12,12,8,9];

    var int+ arrange[jobs,stations] in 0..1;
    var int+ cycletime in 0..5000;

    minimize cycletime
    subject to{
      forall(i in jobs)
        sum(j in stations) arrange[i,j] =1;
        forall(j in stations)
        sum(i in jobs) time[i]*arrange[i,j] <=cycletime; <br />    forall(i in jobs, j in jobs: priority[i,j]=1)
          [color=red]sum(k in staions) k*arrange[j,k]-k*arrange[i,k] >=0[/color];
    };

    Really appriciate your kind advice!

    T.B.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: what is wrong with my opl code?

    Posted 09/22/08 07:10 PM

    Originally posted by: SystemAdmin


    [T.B. said:]

    Dear,

    Please note that "the line in red in the code" should be this one:

    [color=red]"sum(k in staions) k*arrange[j,k]-k*arrange[i,k] >=0;"[/color]

    T.B.
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 3.  Re: what is wrong with my opl code?

    Posted 09/22/08 07:52 PM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    I desintalled OPL3.7 from my machine, but I could find something looking at it in OPL6

    It seems a parenthesis precedence issue.

    try :

    sum(k in stations) (k*arrange[j,k]-k*arrange[i,k]) >=0;

    Alain
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 4.  Re: what is wrong with my opl code?

    Posted 09/23/08 01:02 AM

    Originally posted by: SystemAdmin


    [UDOPS said:]

    Also note in your original code that you misspelled "stations".
    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 5.  Re: what is wrong with my opl code?

    Posted 09/23/08 03:26 PM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    [quote author=UDOPS link=topic=572.msg1731#msg1731 date=1222113718]
    Also note in your original code that you misspelled "stations".


    Indeed. I don't know for OPL3.7, butr OPL6 did give an precise warning on this.

    Alain
    #DecisionOptimization
    #OPLusingCPLEXOptimizer