gpt4 book ai didi

java - 询问队列中是否有座席(AnyLogic 模拟)

转载 作者:行者123 更新时间:2023-12-01 22:35:04 26 4
gpt4 key购买 nike

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

我不知道应该使用什么功能。

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

我尝试使用容量和包含,但没有成功。

请帮忙!!

最佳答案

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

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

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

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

关于java - 询问队列中是否有座席(AnyLogic 模拟),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58529702/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com