question

Korbinian H avatar image
0 Likes"
Korbinian H asked Korbinian H commented

Send Operator to the longest queue and assign it there till queue is empty

Hello guys,

How can I implement a rule to check for the longest queue, then send the operator there and transport and process the items, until the queue is empty?
After this, the operator should be again assigned to next longest queue.

I have attached a model where workers already carry the items and process them afterwards. I have implemented this behaviour like in the Task Sequence Tutorial 2, but the operators still get randomly assigned.

Thanks in advance.

longestqueue.fsm

FlexSim 17.1.2
task sequencequeue contentoperator assignment
longestqueue.fsm (19.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.

Steven Hamoen avatar image
1 Like"
Steven Hamoen answered Korbinian H commented

@Korbinian H I would use process flow for this. Your operators are the tokens and the items are on a list. If your operator looks for items from the same queue. If it can't find one anymore he takes the queue with the highest number, not used by the other operator.

· 3
5 |100000

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

Korbinian H avatar image Korbinian H commented ·

Thank you for your answer!
As i have never used process flow before, I am not able to fully implement your logic. I am not able, to develop a loop to assign an operator until the queue is empty, and release him afterwards to pick a new queue, which is not used by another operator.
I was able to filter the list, so the operator picks items from the longest queue, but i dont know how to compare the length of queues and how to assign the operator to a queue, especially if new items arrive. It would be a great help to me if you could adjust my model.
It already contains a process flow, but without a working loop to check, if there are still items in the queue.
Thanks for your help :) help2.fsm

0 Likes 0 ·
help2.fsm (29.3 KiB)
Steven Hamoen avatar image Steven Hamoen Korbinian H commented ·

@Korbinian H

Here is your model back with some changes. I hope this is what you would had intended?longest-queue.fsm

0 Likes 0 ·
longest-queue.fsm (30.0 KiB)
Korbinian H avatar image Korbinian H Steven Hamoen commented ·

Thank you for your quick reply!
Almost, but after a while (~110 time units) the operators start to unload from the same queue. It looks to me, as if something in the query in the "Pull from List" activity is not working properly.
As I am not to familiar with coding, could you please help me one more time? :D

Furthermore if I change something in the query, the changes just won't be applied, only if i save the model, close and open it again. Might this be a bug of Flexsim?

0 Likes 0 ·
Anna Lisa Dierking avatar image
1 Like"
Anna Lisa Dierking answered Korbinian H commented

@Korbinian H

I have an example for you that worked for me without using Process Flow.

I have 2 global variables (arrays), one containing all the processors and one all the operators. Every processor also has a label containing the operator it is associated with ("Operator") [label is empty onReset] and every operator has a label with the processor he is associated with ("Maschine") [label is empty onReset].

Most of the logic used is inside the processors. I used the onEntry trigger to figure out if there is an operator that is supposed to work that machine. If there is no operator associated the processor looks through the array to see if there is any operator available (= label "Maschine" on operator is empty). If there is a free operator, the label "Operator" on the processor refers to the centerobject-port-number that connects that free operator to the processor.

After the last item leaves the processor, the processor sets the operator free (-> label "Operator" on processor and label "Maschine" on operator are empty). The Processor also sends a message to all the other processors to let them know that they can now look for a free operator if there is no operator already associated with the processor.

I hope this is helpful.

beispielmodell-ald-f1714-rev01-12.fsm


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

Korbinian H avatar image Korbinian H commented ·

@Anna Lisa Dierking Thank you for your model.
I have tried to implement this logic in my existing model. After a while, errors occur, as the processors are not able to pull from the queue anymore. Also I am not able to find a method, how to assign an operator to the longest queue. Do you have an idea, how to solve this issues? Thanks in advance :) 0802-processor.fsm

0 Likes 0 ·
0802-processor.fsm (33.0 KiB)

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.