Dear Daniel,
Many thanks for your response.
Please let's say, I need to define j and t indices over the tasks set on the outer loop.
e4: forall(j,t in tasks: j<t)
sum(h in workers, i in workstation) i*x[i,h,j] <=
sum(h in workers, i in workstation) i*x[i,h,t];
But, this constraint should determine refashions between tasks and whose precedence. this is why I defined such a tuple set. Also, I have tried to use the nested set as follows:
setof(int) operations[tasks] = [{1}, {1}, {1,2}, {1,2,3}, {4,7}, {6}, {6}, {5}, {8}];
Instead of using tuple and define the constraint in the form:
e4: forall(j,t in tasks, jj in operations[j], tt in operations[j]: j<t)
sum(h in workers, i in workstation) i*x[i,h,jj] <=
sum(h in workers, i in workstation) i*x[i,h,tt];
But, when the model is solved, the results are not correct.
I was wondering if, where am I wrong and how can I fix this issue?
------------------------------
Abbas Omidi
------------------------------
Original Message:
Sent: Thu April 30, 2020 10:36 AM
From: Daniel Junglas
Subject: Tuple set issue
I am not sure I understand how exactly you want to add those sets into the constraints. Do you mean something like
forall(t in tasks) ...
and then
sum(j in relations[t].task) ...
? Or do you mean something else? If you mean something else then maybe you can give a short example of the constraint that should be generated for the first task, lets say.
------------------------------
Daniel Junglas
Original Message:
Sent: Thu April 30, 2020 10:24 AM
From: Abbas Omidi
Subject: Tuple set issue
Dear community team,
I'm trying to solve an assignment scheduling problem. I define the problem set as follows:
setof(int) workstation = asSet(1..5);setof(int) tasks = asSet(1..9);setof(int) workers = asSet(1..6);
Now, I need to create a link to define relations between the tasks. Therefore, I try using the tuple concept to do that.
tuple link{ {int} task;};{link} relations[tasks]=[{<{1}>}, {<{1}>}, {<{1,2}>}, {<{1,2,3}>}, {<{4,7}>}, {<{6}>}, {<{6}>}, {<{5}>}, {<{8}>}];
Where "{<{1,2,3}>}" shows the precedence relationship to execute task 4.
Also, I have constraints in the following form.
\begin{equation}\sum_{h \in H} \sum_{i \in I} i . x_{i h j} \leq \sum_{h \in H} \sum_{i \in I} i . x_{i h t} \forall j, t \in N, j<t\end{equation}
------------------------------
Best regards
Abbas
------------------------------
#DecisionOptimization