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