question

Nelson C avatar image
0 Likes"
Nelson C asked Nelson C commented

Change destination continually according with a value label?

In the attached model logistics-cell.fsm, I’m trying to simulate the following system:

11 sources and 11 queues forming a logistic cell

The operator needs to collect boxes from each queue and after collecting 11 boxes, unload them onto “queue_out”.

I was able to do that, as show in the picture attached picture-1.png, in a similar but reduced model. However, I don’t want to use this logic because I would need to have a lot of lists, travel, load and unload activities in the process flow. My intention is to develop a model that can be scalable, then, if I have 50 queues (just an example) I would not want to have 50 “load" boxes in process flow.

I would like to know how to build this logic using fewer activities. I thought using an assign labels + “increment label” and a loop based on a conditional decide could work, according with the attached picture picture-2.png, but I don’t know how to build this logic properly. I’m facing problems in specifying item and destination to the operator to perform his task.

Maybe I could change the destination reference continually according with a value label. Something like: Queue 1, Queue 2, Queue 3... - destination: Queue+ValueLabel

Or can I do something similar to put this logic on track?

FlexSim 19.1.1
labelslistsdestinationincrement label
picture-1.png (322.9 KiB)
picture-2.png (306.4 KiB)
logistics-cell.fsm (30.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.

1 Answer

Joseph Gillespie avatar image
1 Like"
Joseph Gillespie answered Nelson C commented

@Nelson C

You were right about setting a destination label with Queue + a number. I've made here a simple scalable system that will accomplish what you are looking for:

This Process Flow logic creates an Index to keep track of which number queue you are at and increments it at each loop. I then saved a label to the token called "NextQueue" with this value:

Model.find("Queue" + string.fromNum(token.Index))

This takes the index number (number of current queue), makes it a string, concatenates it with "Queue", and finds that specific queue in the model.

Having identified the next queue, you can then travel to it, wait for it to have an item available, and then load the item with this code:

token.NextQueue.subnodes[1]

This will reference the first item in the queue (the only item in this case since you set the MaxContent to 1).

Once Index reaches 11, the token will proceed to the second decide, where the operator will unload items until he has none left. The reference to the top item the operator is carrying:

Model.find("Operator1").subnodes[Model.find("Operator1").subnodes.length]

Once the operator has unloaded all of his items, the whole process loops again.

To scale this to more queues, all you have to do is add more queues and change the first decide from token.Index >= 11 to whatever number of queues you have. Also, if you want the operator to skip queues that have no items in them, that could be easily done using a decide to check if the queue has items in it.

Here's your model with these changes: logisticscellanswer.fsm


capture.png (10.7 KiB)
· 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.

Nelson C avatar image Nelson C commented ·

@Joseph Gillespie

This is exactly what I needed. The model is working properly and I think it will be easy to scale the model following your instructions.

I really appreciate your help, thank you very much!

1 Like 1 ·