簡體   English   中英

詢問隊列中是否有代理(AnyLogic Simulation)

[英]ask whether there is an agent in a Queue or not (AnyLogic Simulation)

我想在 AnyLogic 中編寫一個 function 如果隊列中有代理,則返回 TRUE

我不知道我應該使用什么 function。

if( VIP_Female_Queue." some function that returns true if there is an agent")
{
...
};

我嘗試使用容量和包含,但它沒有工作。

請幫忙!!

這很簡單...要知道隊列中的代理數量,您可以使用幾乎所有 PML 塊中都存在的 size() 方法...在您的情況下,您只需要使用以下代碼:

if(VIP_Female_Queue.size()>0){
    ...
}

如果您想知道某個特定代理是否在隊列中...您可以執行以下操作:

if(agent.currentBlock().equals(VIP_Female_Queue)){
    ...
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM