필터 지우기
필터 지우기

how to determine whether a queue is empty in Simevents and do some actions based on this observation?

조회 수: 3 (최근 30일)
Hi guys,
I want to model a queue with vacations. When the queue is empty, the server will have a period of vacation with certain distribution.(I can use use gate to block the server ) So I need to get the data of the number of entity in queue block. Could you please tell me how to do that?
Many thanks.
  댓글 수: 1
Tianhao Guo
Tianhao Guo 2016년 4월 23일
편집: Tianhao Guo 2016년 4월 23일
Sorry that I am not very familiar with Matlab. Maybe I can write a discrete event-driven queue using customized block. So if you know where to find these kinds of resources. It will be of great help as well.

댓글을 달려면 로그인하십시오.

답변 (1개)

Nikhil Vyas
Nikhil Vyas 2016년 4월 27일
The Queue blocks(and almost all the other similar blocks of simevents) has a Statistics Tab in the Block Parameters.
This would result in an additional port #n appearing on the block. You can monitor this port to check the number of entities in the queue at any time. If #n gives you 0, the queue is currently empty.
  댓글 수: 1
Tianhao Guo
Tianhao Guo 2016년 4월 27일
Thank you for you answer. Sorry, I didn't explain clearly. A queue with vacation means that I need to close the gate as soon as the queue is empty. Then how to monitor this port? Maybe I should let the queue trigger something when it is empty.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Messages에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by