[英]how to plot Probability density Function (PDF) of inter-arrival time of events?
[英]Anylogic: How to plot arrival rate per hour of agents in enter block?
myDS
。 确保取消勾选“使用时间作为水平值”(我们将使用时间,但以小时为单位)counter
在事件代码中,编写:
myDS.add(time(HOUR), counter); // stores number of arrivals in the past hour, stored at the current model time
counter = 0; // reset for next interval
在enter
块的“on enter”代码中,每次代理到达时更新计数器,使用counter++;
现在您有一个 DS,它存储了每小时到达的代理数量。 Plot 那一次 plot 和你对 go 很好。
创建一个每小时发生的循环事件。 还将两个数据集添加到您的 model 中:一个名为累积到达,另一个到达(当然,随意命名数据集对您有意义)。 最后添加一个名为count的int
类型变量,初始值为 0。
然后,在事件操作字段中,编写以下代码:
cumulativeArrivals.add(enter.out.count());
if( count == 0 )
arrivals.add(cumulativeArrivals.getY(count));
else
arrivals.add(cumulativeArrivals.getY(count) - cumulativeArrivals.getY(count-1));
count++;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.