Using queue size to permit entity creation

3 ビュー (過去 30 日間)
Paul
Paul 2013 年 2 月 3 日
編集済み: Tianhao Guo 2016 年 4 月 23 日
I have a manufacturing model that has several queues after servers. I would like to use the number of entities in one particular queue to trigger a hold on entity creation i.e. if more than 20 entities in the queue then stop feeding in more raw materials from inventory.
I assume I'll use an event based entity generator (or time based with release gate) and know how to get queue size out of the queue but am unsure how to use this to generate the function to release or create an entity.
I can see Simulink has many logic (e.g. relational operator) functions that I can drag in but would have thought this so common that Simevents would have its own blocks.
Do I need to use logic blocks from Simulink to trigger entity creation / release or is there a more elegant or integrated way from Simevents?
Thanks
P
  1 件のコメント
Tianhao Guo
Tianhao Guo 2016 年 4 月 23 日
編集済み: Tianhao Guo 2016 年 4 月 23 日
I have almost the same question. Now I think we can make an output port from queue block "number of entities in block, n". Then use it.
The question is that I don't know how to trigger a function when the "number of entities in block, n" becomes zero
https://uk.mathworks.com/matlabcentral/answers/280589-how-to-determine-whether-a-queue-is-empty-in-simevents-and-do-some-actions-based-on-this-observation

サインインしてコメントする。

採用された回答

Devdatt Lad
Devdatt Lad 2013 年 2 月 3 日
編集済み: Devdatt Lad 2013 年 2 月 3 日
If you can set the Capacity of the Queue to be 20, then the Time-Based Entity Generator that is feeding this Queue can be configured to Pause when it is blocked. Hence when the number of entities in the Queue is 20, the Generator will stop generating, until the number goes down to 19, in which case it will generate one more and so on. So you don't need any Logic blocks in this case. Just connect the Generator to the Queue and SimEvents will do the rest for you.
However, if you need the Queue Capacity to be more than your threshold or if your threshold (of 20) varies throughout the simulation based on some criteria, then your best bet is to use the Logic blocks from Simulink for this.
  3 件のコメント
Devdatt Lad
Devdatt Lad 2013 年 2 月 4 日
It doesn't have to feed straight to the buffer. It can have blocks in between as long as these blocks are not other buffers (queues or servers).
Paul
Paul 2013 年 2 月 4 日
thanks for clarifying. In this case there are both queues and servers between points.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMessages についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by