【发布时间】:2020-02-20 02:31:28
【问题描述】:
我想在 AnyLogic 中编写一个函数,如果队列中有代理,则返回 TRUE
我不知道我应该使用什么功能。
if( VIP_Female_Queue." some function that returns true if there is an agent")
{
...
};
我尝试使用容量和包含但没有成功。
请帮忙!!
【问题讨论】:
标签: java queue simulation anylogic
我想在 AnyLogic 中编写一个函数,如果队列中有代理,则返回 TRUE
我不知道我应该使用什么功能。
if( VIP_Female_Queue." some function that returns true if there is an agent")
{
...
};
我尝试使用容量和包含但没有成功。
请帮忙!!
【问题讨论】:
标签: java queue simulation anylogic
这很简单...要知道队列中的代理数量,您可以使用几乎所有 PML 块中都存在的 size() 方法...在您的情况下,您只需要使用以下代码:
if(VIP_Female_Queue.size()>0){
...
}
如果您想知道某个特定代理是否在队列中...您可以这样做:
if(agent.currentBlock().equals(VIP_Female_Queue)){
...
}
【讨论】: