首页 文章

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

提问于
浏览
0

我傻眼了为什么我无法正确模拟一个简单的队列系统 .

The system is as follows:

流量泊松流(指数分布),每2分钟1个代理的速率 .

容量为2的队列 .

两(2)台服务器,每个服务器每3分钟服务一个代理 .

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

在Anylogic中,我已经像这样建模了系统:Model

使用到达间隔时间'2'指定源元素,并且当代理无法进入系统时销毁代理(因为队列已满) . source EDIT: As pointed out by Felipe it should be "exponential(0.5)" instead of simply "2"; Nevertheless this does not solve the problem. The measurements are still wrong: The queue has now an average length of 0.55 vs. 0.413 (should be), the system has now an average number of agents of 1.92 vs. 1.727 (should be) and the average loss rate is 8.67 % vs. 12.4 % (should be).

使用容量'2'和FIFO机制指定队列 . queue

延迟元素的容量为'2',延迟时间为'exponential(1.0/3.0)'分钟 . delay

水槽是普通的香草 . sink

现在,队列理论告诉我们,我们期望在系统中观察到1.727的极限平均代理数 . 并且队列中的代理数限制为0.413 . 并且平均损失率(代理商被破坏)为12.4% .

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

可以通过'source'元素中的'On Discard'操作轻松计算丢失率:“CountLost;” ('CountLost'是我创建的变量)然后我可以将'CountLost'变量与创建的完整代理数进行比较 .

我的错是什么?

非常感谢您的帮助!马丁

EDIT2: Felipe asked for the calculation: Calculation

1 回答

  • 0

    好的,我解开了这个谜 . 事实上,当使用"Agents which can't exit: are destroyed"时,Anylogic似乎在源元素中有一个错误 . 我使用源中的"Forced pushing"和直接连接到源的selectOutput重新构建了系统 . 如果队列已满,selectOutput将代理路由到第二个(discard)-sink . 像这样:NewModel

    现在测量是正确的 .

    EDIT: I received word from the Anylogic Support: "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."

相关问题