I have a problem involving work shifts and assembly stations.
- Work shifts have the subscript = T
- Workstations have the subscript = J
My decision variable is X[t][j]
For each turn (T) I am trying to use the value of the array below and substract a generic value like (2) through each assembly station (J).
For example: AM[t][j] matrix
For each shift [t] X[t][j] = M1[t][j] + X[t][j] – 2.
Example first shift (time), and each work station (j).
- X1 = 100 + 0 – 2 = 98
- X[1][2] = 0 + 98 – 2 = 96
- X[1][3] = 0 + 96 – 2 = 94
Example second shift (time), and each work station (j).
- X2 = 0 + 200 – 2 = 198
- X[2][2] = 0 + 198 – 2 = 196
- X[2][3] = 0 + 196 - 2 = 194
This is my cplex code.
subject to {
forall (t in T, j in J)
Constrain2: X1[t][j] == sum (j in J) M1[t][j] - 2; }
However, I get the following results
- X1 = 98
- X[1][2] = 98
- X[1][3] = 98
It is not decreasing, it just puts the same value of the previous box.
Could you advise me how to subtract the value through each workstation for each time.
Thank you for your help.