question

Marc B avatar image
0 Likes"
Marc B asked Joshua S commented

How to Send or Pull more then one itemtype

Hallo

I have to send or pull flowitems based on their ItemType to specific Processors

Prozessor1 should get ItemType 1 or 2
Prozessor2 should get ItemType 1 or 2
Prozessor3 should get ItemType 3 or 4
Prozessor4 should get ItemType 3 or 4

I was not able to program that or in to the Pull Requirement. How can I do that?

problemverteilung.fsm

FlexSim 18.1.0
send to portpull requirement
capture.png (120.8 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Raja Sekaran avatar image
2 Likes"
Raja Sekaran answered Joshua S commented

@Marc B

I have attached the model with the changes.

You can specify the item types in Array of ItemTypes.

Hope this works for you

Thanks

marc-support.fsm


capture1.png (41.4 KiB)
marc-support.fsm (20.3 KiB)
· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Marc B avatar image Marc B commented ·

I have an additional question to the array solution:

If I prefer to control the flow over the output (send to port), how I have to write the code?
I tried this one, but it doesn't work:

Object item = param(1);
Object current = ownerobject(c);

Array port1 = [1, 2, 3];
Array port2 = [4, 5, 6];

int condition = /** \nCondition: *//***tag:expression*//**/getitemtype(item) == 1 || getitemtype(item) == 2/**/;

return condition?port1:port2;

0 Likes 0 ·
Joshua S avatar image Joshua S Marc B commented ·

One way to do this is to push the items onto a list and partition them by type, and then have your ports pull from the list by partition ID.

Hope this helps.

0 Likes 0 ·
pic1.png (16.2 KiB)
pic2.png (22.0 KiB)
Emily Hardy avatar image
1 Like"
Emily Hardy answered Emily Hardy edited

In order to pull from two different Types, you can use the pull requirement "Range of Item Types" and set the limits to 1 and 2, or 3 and 4.

I've attached your file with these changes made. I also removed the sorting processor, as the processors can pull directly from the queue. Hope this helps.

11918-problemverteilung.fsm


5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.