Hello,
I have difficulties to make a set {int}, I want to make a: Set of total predecessors of task i of product of line h.
Where:
range H = 1..2 ;
range tasKRange = 1..5 ;
Th= {int} conjTask [h in H] : [ {1 2 3 4 5} {1 2} ] ;
IPhi = {int} conj_IPhi [h in H, i in tasKRange ] : [ [ {} {1} {2} {2} {3 4} ] [ {} {1} {} {} {} ] ] ;
tuple predtask{
int h; // Líne num
int i; // task
int tt; // task time
int taskP; // Predecesor task
int taskS; // Sucesor task
}
{predtask} PredTask=…;
PredTask={//Line Task Time Pred Suce
< 1 1 2 0 2 >,
< 1 2 1 1 3 >,
< 1 2 1 1 4 >,
< 1 3 3 2 5 >,
< 1 4 4 2 5 >,
< 1 5 2 3 0 >
< 1 5 2 4 0 >,
< 2 1 4 0 2 >,
< 2 2 4 1 0 >,
};
The desired result is:
{int} conjuntoPredTot [h in H, i in tasKRange ] = [ [ {}, {1}, {1,2}, {1,2}, {1,2,3,4} ]
[ {}, {1}, {}, {}, {} ];
I tried to do it with the following code but I don’t get the expected results:
{int} conjuntoPredTot [h in H, i in taskRange, j in taskRange] = { e.i | e in PredTask : h == e.h && j == e.taskS && j <= i } ;
Many thanks in advance.
Best Regards
Source: Problem in set configuration