question

Michael D6 avatar image
0 Likes"
Michael D6 asked Matthew Gillespie answered

Multi Queue Creation

Multi Queue Object Creation.fsmReally easy question that I cant seem to find a great resource on. I found resources on movement to a group of queues but not creation in a group. I want to just make a box in each queue within a group without having a seperate create object in process flow for each. I have a scenario with a lot of queues and this seems like the wrong way to do this. I dont think I am referencing the group currently. Any help is appreciated.


FlexSim 21.2.3
queue
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
0 Likes"
Matthew Gillespie answered

Here are 3 ways to do this with a single Create Object activity.

Create_For_Each_Queue_In_Group.fsm

1. Gray Queues - In the Source the Quantity is set to Group("Container").length so that it creates one token per queue in the group. Then I add a Queue label to the created tokens with a value of Group("Container")[tokenIndex]. Now we have a token for each queue with a Queue label that points at that queue. In the Create Object we can now just create one box in token.Queue.

2. Red Queues - The source creates a single token and then the Run Sub Flow creates a new token for each queue in the group and sends it to the sub flow. We do this by setting the Quantity in the Run Sub Flow to Group("Container2").length and adding a Queue label to the created tokens with a value of Group("Container2")[creationRank]. In the Create Object we can again just create one box in token.Queue.

3. Blue Queues - I created a new Object process flow and named it Blue Queue. Then I attached this flow to all the blue queues. The process flow is super simple. The Source creates a single token and the Create Object activity creates a single box in current which is the object attached to the flow. This works because the flow makes a separate instance of the flow for each attached object which you can refer to as current.

The great thing about any of these methods is that you can copy and paste (or even delete) any of these queues and the flows will automatically handle the extra queue.


5 |100000

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

Nathan B14 avatar image
1 Like"
Nathan B14 answered

Thank you for your question @Michael D6. I found another post that may be helpful in answering your question. Feel free to read through it and see if you can apply the solution they discussed.

Additionally I created two other possible solutions. The example models are attached. The first uses an additional queue as the creation location and has ports to each of the other queues. This makes it so the objects are created in the additional queue and then instantly moved to each of the other queues. The second uses multiple create object tasks in the process flow. To clean up the process flow however a sub flow was used. Neither option seems to be a perfect solution but accomplishes what you are intending.

Hopefully the other post or either of the two options will be helpful. If you have any further questions please let us know. Thank you.


Example Model Send to Multiple Queues.fsm

Example Model Send to Multiple Queues 2.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.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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