繁体   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