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

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

问题描述

我有一个供应链交付模拟,其中三个车辆代理商正从制造商转移到客户,该模型基于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天全站免登陆