方法测量模拟期间代理未使用的时间 [英] Method the measure the time an agent is not in use during a simulation

查看:10
本文介绍了方法测量模拟期间代理未使用的时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个供应链交付模拟的模拟,其中三个车辆代理从制造商转移到客户,该模型基于 AnyLogic 网络研讨会,用于使用 GIS 进行交付车队优化.并且流程图逻辑是这样设置的:

我试图从模拟中提取一些时间.其中一个时间是代理两次旅行之间的时间,因此需要找到代理在模拟期间没有移动的时间,理想情况下,这将对每辆车单独完成或提供平均类型的事情.

我在这里看到了一个例子:

I have a simulation for a supply chain delivery simulation where three vehicle agents are moving from a manufacturer to customers, the model is based on the AnyLogic webinar for Delivery Fleet Optimization with GIS. And the flowchart logic is set up like this:

I am trying to extract some times from the simulation. One of these times is the agent time between trips therefore need to find the time that the agent is not moving during the simulation, ideally this would be done for each vehicle individually or provide the average kind of thing.

I have seen an example here: TimeMeasurementStart and End Where it is discussed you can use a code to collect time data instead of the blocks however some assistance on the specifics of the code required or where that code goes would be really helpful if anyone has any tips!

My assumption would be that if I could say something like: total time - time moving = time not moving

Any help would be appriciated! Natasha

解决方案

First, make sure your trucks are custom agent types that you created yourself, lets call them Truck. Also, your MoveTo blocks must know that it is Truck agents flowing through it (set "Agent type" under "Advanced" to Truck)

Add a variable timeDriving and another timerStart to it. The former is used to sum all driving durations. The latter is used temporarily to measure when driving starts.

Then, use the code boxes in all MoveTo elements as below:

这篇关于方法测量模拟期间代理未使用的时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆