询问队列中是否有代理(AnyLogic Simulation)

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

我想在 AnyLogic 中编写一个函数,如果队列中有代理

,returns TRUE

不知道应该用什么功能

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

我尝试使用 capacity 和 contain,但没用。

请帮忙!!

这很简单...要知道队列中代理的数量,您可以使用几乎所有 PML 块中都存在的 size() 方法...在您的情况下,您只需要使用以下代码:

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

如果您想知道某个代理是否在队列中...您可以这样做:

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