【问题标题】:ask whether there is an agent in a Queue or not (AnyLogic Simulation)询问队列中是否有代理(AnyLogic Simulation)
【发布时间】: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


    【解决方案1】:

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

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

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

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

    【讨论】:

    • 请在您的回答中描述问题是什么,以及这个 sn-p 将如何解决它,以帮助其他人理解这个答案
    猜你喜欢
    • 2017-11-12
    • 2016-08-19
    • 2021-11-08
    • 2022-12-02
    • 2020-12-13
    • 1970-01-01
    • 2021-11-18
    • 2019-11-29
    • 2020-08-04
    相关资源
    最近更新 更多