question

browna15 avatar image
0 Likes"
browna15 asked Julie Weller commented

Preventing Source from Generating Specific Flow Type Upon Trigger

In the scenario that I am trying to model, the source does not create a specific flow item once the queue for that flow item has reached capacity (8 units). Currently, the model will have the source continue to generate any of the possible flow items it can generate. In the figure below, the flow item that is blocking queue 8 should not have been generated to begin with.

1690909987847.png

Model:TestModelQueue.fsm


Thank you for the consideration!

FlexSim 17.1.6
sourcegenerationmax queue
1690909987847.png (730.8 KiB)
testmodelqueue.fsm (108.0 KiB)
· 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.

Carter Walch avatar image Carter Walch commented ·
Can you reattach your model? It didn't upload correctly. Thanks
0 Likes 0 ·
browna15 avatar image browna15 Carter Walch commented ·

Thanks for catching this. I reuploaded.

0 Likes 0 ·

1 Answer

·
Julie Weller avatar image
0 Likes"
Julie Weller answered Julie Weller commented

Hey @browna15! You could do something like this in process flow to implement that:

1690912449988.png

The inter-arrival source would be the same as your original sources. then the wait for event would have something like this:

1690912276530.png

The max wait timer and the label it sets are important because it allows you to maintain the inter-arrival time. The label that is set is what you will use in the decide to determine if it goes to the sink (if the label is on the token), otherwise it should create an item probably on the entry transfer that you want and probably set a type label on the item (you will probably need to mess with that a little). Let me know if you have any follow up questions!


1690912276530.png (55.4 KiB)
1690912449988.png (20.5 KiB)
· 11
5 |100000

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

browna15 avatar image browna15 commented ·

Hi Julie,

Thank you so much for the response! I don't quite follow how it works. How I understand it, it will create a token of any type, count if it has created 8 in the queue, then put a timer on that specific type from being generated again? From my understanding, I will only be allowed to follow a fixed interarrival rate this method when the source releases flow items from a Poisson(60,0) distribution. Its important that the sources release flow items not at the same instance, but randomly.

Also, I would have to make this process flow addition for each queue for each source? So if I have 15 sources with 8 queues, then 120 total iterations of this process flow? Lastly, I tried implementing the process flow with no success. If you can, leaving a version of the model with the edit or tell me what I did wrong in the screenshot below would help. Thank you!

1690981070277.png1690981090338.png


0 Likes 0 ·
1690981070277.png (178.7 KiB)
1690981090338.png (120.5 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦ browna15 commented ·

You create the Object Process Flow for a generic source with the bahaviour your need and then add your 120 instances to it. What makes them behave in a unique way will be the setting of labels to point to different objects. This way you refer to each member object as current. So if each source has a pointer label called 'queue' then you refer to that instance's queue as 'current.queue'. Moreover if you copy/paste sets of objects that refer to each other, those references are adjusted automatically to the new pasted objects. You can also use Templates to manage sets of child objects that inherit from a master.

If, based on the distribution, you should create an item for Queue8 and it is full, then you need to decide if you ignore that (delete the item/token) or just queue it until Queue8's content subsides, knowing that other items may be generated by that source while it's queued.

0 Likes 0 ·
browna15 avatar image browna15 browna15 commented ·
Hi Julie, I am also coming across an issue when I implemented this process flow with token ids not being updated and it caused the model to crash. Can you edit the model so I can understand where I went wrong and cross reference. Thanks for the consideration.
0 Likes 0 ·
Julie Weller avatar image Julie Weller browna15 commented ·

Hi @browna15! I get that it can be a little tricky to implement. Here's what I did (and fair warning you might need to edit the model because I got a little lost about what Type goes to which queue and the tiny percentages in creating the Types):


First I made that process flow above but I took Jason's advice and used an object flow and then attached it to a queue, like this:

1691013417464.png

The source creates the objects every possion(60,0).

The assign labels assigns 2 labels to it (the Type and an isQueueFull label I use later but start out with it at 0 or false).

Then the custom code block checks what queue that Type is associated with and if the queue is full it sets the isQueueFull label on the token to 1 (or true). You really need to double check the code, especially these lines:

1691013595800.png

Because I'm pretty sure I didn't quite capture what Type is assigned to which queue.

The decide either sends the token to be created or not depending on the isQueueFull label.

Then the last two activities create the actual item and the color.

You can add more "sources" (really just queues to create the items in) using the instances selector in the object process flow:

1691013916823.png

I hope that clears things up! You'll definitely need to fix it up but it should give you a place to start, here's the model:

testmodelqueue.fsm

1 Like 1 ·
1691013417464.png (64.5 KiB)
1691013595800.png (51.8 KiB)
1691013916823.png (12.8 KiB)
testmodelqueue.fsm (112.9 KiB)
Show more comments

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.