Dear support team,
I am working on a special form of the bin-packing model where there is a planning horizon for the problem. Let's say,
T denotes the scheduling length,
I and
J referred to the items and bins respectively. Also, the following notations are defined.
𝑡_lo(𝑖): Availability time;
𝑡_up(𝑖): Latest delivery time, with Tau(i) = [𝑡_lo(i), 𝑡_up(i)];
gamma(𝑗) = [gamma_lo(𝑗) , gamma_up(𝑗) ]: Availability time window for bins;
alfa(j): Travel time;
Tau(i,j): be the item-to-bin assignment interval->
Tau(i,j) = [𝑡_lo(i), 𝑡_up(i)-alfa(j)] intersect gamma(j);
Now, there is a binary decision variable
x(i,j,t) that equals one if, item (i in
I) is being assigned to the bin (j in
J) at time plan (t in
Tau(i,j)), otherwise zero.
Also, one of the model's corresponding constraints is:
(sum(j in J) sum(t in Tau(i,j)) x(i,j,t)) + (sum(t in Tau(i)) u(i,t)) = 1 ; forall(i in I)
I have tried to write the sets and constraints as follows:
{string} items = {"item_1", "item_2", "item_3", "item_4"};
{string} bins = {"bin_1", "bin_2", "bin_3"};
{int} horizon = {1, 2, 3, 4, 5, 6, 7};
setof(int) a_time[horizon] = [{1}, {1}, {1}, {1}, {1}, {1}, {1}];
setof(int) l_time[horizon] = [{7}, {7}, {7}, {7}, {1}, {1}, {1}];
setof(int) a_gamma[horizon] = [{1},{1}, {1}, {1}, {1}, {1}, {1}];
setof(int) l_gamma[horizon] = [{7},{7}, {7}, {7}, {7}, {7}, {7}];
dvar boolean x[items][bins][horizon];
forall(i in items)
c2: sum(j in bins, t,tt in horizon: t in a_time[tt] && t in l_time[tt])
x[i][j][t] + sum(t,tt in horizon: t in a_gamma[tt] && t in l_gamma[tt]) u[i][t] == 1;
But, It seems to make the problem hard and the result is far from what we expected.
I was wondering if, how can we define these kinds of sets and whose bounds? (specifically, based on the items and bins).
Regards
------------------------------
Abbas Omidi
------------------------------
#DecisionOptimization