Anylogic M/M/2/[4] 系统没有正确模拟?

Anylogic M/M/2/[4] system is not simulated correctly?

我傻眼了,为什么我不能正确模拟一个简单的队列系统

系统如下:

以每 2 分钟 1 个代理的速率流入泊松流(指数分布)。

容量为 2 的队列。

两 (2) 台服务器,每台服务器的服务速率为每 3 分钟 1 个代理。

如果系统已满(服务器和队列中的两个位置都被占用)新代理不会进入系统而是被销毁。

在 Anylogic 中,我对系统进行了建模,如下所示: Model

源元素指定了到达间隔时间“2”,代理在无法进入系统时被销毁(因为队列已满)。 source 编辑:正如 Felipe 所指出的,它应该是 "exponential(0.5)" 而不是简单的“2”;尽管如此,这并不能解决问题。测量结果仍然错误:队列现在的平均长度为 0.55 对 0.413(应该),系统现在平均代理数为 1.92 对 1.727(应该),平均丢失率为 8.67% 对. 12.4 % (应该是).

队列指定了容量“2”和先进先出机制。 queue

延迟元素指定容量为“2”,延迟持续时间为 'exponential(1.0/3.0)' 分钟。 delay

水槽是普通的香草味。 sink

现在,队列理论告诉我们,我们期望观察到系统中代理人的平均数量限制为 1.727。队列中代理的限制平均数为 0.413。平均损失率(特工被摧毁)为 12.4%。

但是当我用 Anylogic 模拟系统时,我得到了不同的结果。 奇怪的是,队列中代理的平均值是正确的,为 0.413。 但是任意逻辑模拟中的平均损失率约为 1.7%,系统中代理的平均值约为 1.83。

损失率可以通过 'On Discard' 中的操作轻松计算 'source' 元素:"CountLost++;"('CountLost' 是我创建的变量)然后我可以将 'CountLost' 变量与创建的代理总数进行比较。

我的错误是什么?

非常感谢您的帮助! 马丁

EDIT2:Felipe 要求计算:Calculation

好的,我解开了谜团。 事实上 Anylogic 在使用时似乎在源元素中有一个错误 "Agents which can't exit: are destroyed"。 我在源中使用 "Forced pushing" 和直接连接到源的 selectOutput 改造了系统。如果队列已满,则 selectOutput 将代理路由到第二个(丢弃)接收器。 像这样:NewModel

现在测量结果正确了。

编辑:我收到 Anylogic 支持的消息: "Actually the Source block that destroys agents if queue is full stores 1 agent inside (if the agent cannot exit). Only the 2nd and subsequent agent is destroyed. In this case the model behaves like there is queue with capacity = 1, then goes the queue with capacity = 2, and finally Delay and Sink. This is old feature of Source block, it occurs due to the pull-protocol. I have posted the task for the developers to implement the option with instant destroy of the agents that cannot exit."