question

Brayan Leonardo Gil Guevara avatar image
0 Likes"
Brayan Leonardo Gil Guevara asked Adrian Haws commented

How to send items to specific output ports

Hi, good afternoon.

I'd like some help. The file attached "samplemodel.fsm" works as follows:

- The Queue 1 has the "Send to Port: 1" (Processor 5).

- If the item stays more than 300 time units at Queue1, the item will be send to Queue2. (In order to do that, it has three Triggers working on Queue1. OnEntry, OnExit, OnMessage).

What I'd like to do is to send the item to the FIRST RANDOM AVAILABLE of the 3 Processors that Queue1 has connected.

What should I do in order to send the items from Queue1 randomly to a list of processors?

FlexSim 16.1.0
FlexSim 7.7.0
listsend to portitem flowrandom listspecific output ports
1.png (168.6 KiB)
queu1.png (14.2 KiB)
samplemodel.fsm (16.9 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.

Matthew Gillespie avatar image
3 Likes"
Matthew Gillespie answered Brayan Leonardo Gil Guevara commented

I would suggest using a list where the first queue pushes to that list and the processors and the second queue pull items from that list. Here is an example model that shows this method.

In the Queue's Send To Port field it pushes each item to a list.

The processors then pull items from that list using their Pull Strategy field.

Queue2 also pulls from the list, but with a query of age > 300. I had to add a list reevaluation event to the list for the old items to be reconsidered.

Alternatively you could use Process Flow to control the items that time out. Here is an example modell of that.


· 1
5 |100000

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

Adrian Haws avatar image
1 Like"
Adrian Haws answered Brayan Leonardo Gil Guevara edited

There is a drop-down list by Send To Port with several options. It sounds like the best option for what you'd like to do is Random->Random Available Port.

· 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.

Edward Ellis avatar image
0 Likes"
Edward Ellis answered Adrian Haws commented

Hi @Matthew Gillespie @Adrian Haws I have a quick question.

I want to validate the itemtype and in the case that it has getitemtype(item) == 1 or 2 I want it to go to certain ports. It is working when I state getitemtype(item) == 1 but how do I add to validate for 2 as well?

Do I use commas, or, what do I do to validate the itemtype for both 1 or 2?

Thank you for your help!

Edward Ellis

· 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.