Hi, I'm trying to build a model where consignments enter multiple upstream queues(Q3,Q4). As soon as a consignment is completely inside Q3/Q4, a functions looks for a calculated number (N) of processors downstream, which are available (P8,P9,P10,P11,P12) [Available means not processing any other consignment from other queue]. For example if a consignments(C1) gets completed in Q3, and N = 3(based on load). I look up for 4 processors and find 3(P8,P11,P12) successfully. I set their avail_flag = 0 so that no other consignment can use them. Then I releaseitem() all items of C1, and assign port to each item using duniform(1,3). This is a good strategy except that it's not accurate. What I want is that I could only open output port (P8,P11,P12) and assign SendToPort "0" for each item. This way item are free to enter any of the three port, instead of hard coding each item using duniform. But as we know closeip(current, port_num) doesn't work well with discrete events. What should I do ? Is there a better way than dunifrom() ?
PS: Consignment control in Q3/Q4 is achieved by holding item (SendToPort -1) for each entering item and when consignment completes, releaseitem(). For for releaseditems, SendToPort = random port assigned using duniform() .