フィルターのクリア

How do i find out if a queue is not empty?

2 ビュー (過去 30 日間)
Baf85
Baf85 2021 年 6 月 18 日
コメント済み: Baf85 2021 年 6 月 26 日
Hi. I'm modelling an elevator with SimEvents. Therefore i want to know at certain points, if there's someone waiting in the different levels of the building, which means there's an entity in the respective entity queue. My idea was to compare the number of entities in the queue with a compare to constant block. But then i don't know how to continue.
Regards!

回答 (1 件)

Abdolkarim Mohammadi
Abdolkarim Mohammadi 2021 年 6 月 24 日
At such points, the next block to which the Compare blocks are connected, is a Hit crossing block.
  2 件のコメント
Baf85
Baf85 2021 年 6 月 26 日
Thank you, for your answer, but i've already found another solution.
i created a function where i can check different queues. 1-7 are the signals from the different queues and u is the queue i wanto check. If there's an entity in the queue y = 1 if not y = 0.
Baf85
Baf85 2021 年 6 月 26 日
In the picture above is an error. It should be if(u8==1), elseif(u8==2)...

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

カテゴリ

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

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by