question

dupapupa avatar image
0 Likes"
dupapupa asked Felix Möhlmann commented

I have logic issue

Hi, I've been struggling with a problem for about a week now. It's completely simple and relies entirely on logic, but I seem to be having some trouble.


Basically, you have 3 sources and each of them creates an item (task) with its own type A, B and C. They go into one queue and then into the processor. Tasks of type A and B (yellow and green, respectively) can be processed by the system's processor simultaneously in the amount of up to 5, but provided that there is no task of type C (red) on the processor at the moment. In this case, they must wait until the task of type C finishes its processing.

1714402579556.png

In turn, tasks of type C require that the processor is free from other tasks. If there is something on the processor, then this task must wait until all tasks on the processor have completed their processing.


As you can see, these conditions are mutually exclusive and still simple, but I got stuck at the stage of implementing them in the model. I tried to use messages, but everything turned out to be quite laggy and did not work as required by the conditions.


Any help, hints or suggestions will be much appreciated.

My model so far (i can't upload model , so here is link to drive): https://drive.google.com/file/d/1MBnKpXZq_Uh7MKojmFh1okaJHSRjl_io/view?usp=sharing

FlexSim 23.1.0
simulations
1714402579556.png (144.2 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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

There are likely many other possible solutions, but here is one I find relatively straightforward and 'elegant'.

The queue is set to not release items by itself. The items will instead be released to the processor by a Process Flow. In this Process Flow an Event-Triggered Source listens for items entering the queue. Depending on the type of the item, the token is assigned a 'weight' of either 5 (type C) or 1 (other types).

Before the token releases the item it has to enter a zone. A subset is defined for this zone that includes all tokens and limits the content by the sum value of the "weight" label (Subset Constraints). So either one type C token can enter or up to five other tokens. The token then waits for the item to exit the processor and then leaves the zone.

zone-subset-limit.fsm

If the items should be processed in FIFO order (type A and B items can't overtake type C), activate the "Enforce Queue Order" option on the Advanced tab of the zone settings.

1714405035824.png


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

dupapupa avatar image dupapupa commented ·

Wow, it actually works! To be honest, i am not particularly into Process Flow, but this concept with subset zone and weights is pretty elegant, as you said, and easy to understand. Thank you! One thing i don't really get is those "breath" sections with zero time delay, but I don't think they matter much, right?

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann dupapupa commented ·
They are there to make sure that any internal logic of the queue and processor have finished before an item is released to the processor.

They probably are not necessary here, you are right. But experience has taught me to err on the side of caution when it comes to timings in FlexSim.

0 Likes 0 ·