Cut off new arrival of entites to server until server is completely empty again

3 ビュー (過去 30 日間)
Hi community
In this situation, please assume that the entity creator creates entities much faster than the server serves them, leading to the server getting to full capacity quickly after simulation start.
My question is this: I would like the server to start taking in entites until it reaches max capa. Then, it should not receive any new entities until it has served all entities and all entities have departed (so, no new entities should arrive until number of entites in block goes back to zero). Then it should fill up again until its full and so on. What I don't want is for 1 entity to arrive newly from the entity creator the instant that one served entity departs. The capa of the server should fill up to max and new arrival of entites to the server should be cut off until the server is completely empty again.
I can't figure out how create a mechanism like that. I tired a lot with entity gate blocks, but I can't get it to work. I would be thankful if someone could offer a solution.
Thanks in advance!

採用された回答

Abdolkarim Mohammadi
Abdolkarim Mohammadi 2021 年 9 月 3 日
The solution is to place two Hit crossing blocks to detect the state of the server. When the server is full, the gate closes, and when the server is empty, the gate opens. I have attached the model. You can open the two scopes to see when the open/close messages are sent, and the number of entities in the server. I hope it helps.
  3 件のコメント
Abdolkarim Mohammadi
Abdolkarim Mohammadi 2021 年 9 月 3 日
編集済み: Abdolkarim Mohammadi 2021 年 9 月 3 日
Wise question!
Hit crossing's messages are not simple messages, "The [Hit crossing's output messages'] data type is slHitCrossingType which is an enumerated data type," according to the documentation of the hit crossing block. You can simplify enumerated data types as an attribute-like thing, where enumerated names are linked to the attribute names and enumerated values are something like values. Hit crossing's messages have four enumerated names: CrossingType, Index, Time, and Offset. But simple SimEvents' messages , which are also called anonymous or untyped entities, are just a value; nothing more. The Entity gate block actually accepts such anonymous entities, not enumerated types. The reason is simple: the Entity gate block does not know which enumerated name to consider as the gate control value. But the anonymous entities have just one value and the Entity gate block does not get confused. Therefore, we need to convert the enumerated data type to anonymous entities.
You can also create the model below and open the event actions tab of the Entity server to see the enumerated names, which act like entity attributes.
Robert Kugler
Robert Kugler 2021 年 9 月 4 日
Got it! Thanks a lot of the elaborate explanations!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDiscrete-Event Simulation についてさらに検索

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by