Anylogic 中的时间分布和处理所花费的时间

2024-01-02

我正在研究生产模型,其中原材料的输入按小时计算,我运行该模型 8 小时(1 个班次),所以基本上有 16 小时资源闲置。当我没有使用计划部分并运行模型 8 *7 小时(56 小时)时,每个作业的时间测量都很好,但现在当我计划输出时,它也包括空闲时间。那么我怎样才能只计算繁忙时间来查看车间中一项工作所花费的平均时间(从原材料到成品。

这是一个作业在一个进程中花费的时间,应该是 34-16= 大约 18 https://i.stack.imgur.com/pXM78.png


首先,需要注意的是:虽然您声明您轮班 8 小时,但上午 8 点到下午 6 点的时间段实际上是 10 小时,因此我将在此解决方案中忽略它,而是假设轮班实际上是 8 小时并从 9 点开始运行: 00 至 17:00。

这是一个用于测试的简单模型(模型时间单位是秒):

实现这项工作有 4 个要素:

  1. Service必须配置为允许抢占任务并进行恢复,这是通过使用优先级/抢占选项如下:
  1. 资源池必须配置“班次结束”抢占,如下所示:
  1. 真实时间(不包括班次之间的停滞时间)的计算是在f_calcTATsec功能:
// get 'Service' enter time for that agent
double startTime = col_startTimesSec.get(_agent);

// calculate time spent
double timeSpent = time() - startTime;

traceln("%.2f: agent spent %.2f in service", time(), timeSpent);
traceln("%.2f: 8hrs is %.2f, 16hrs is %.2f", 
    time(), (8 * hour()), (16 * hour()));

// below is a ternary statement which says:
//   if 'timeSpent' is less than 8 hrs then use it
//   otherwise 
//      exclude whole 16 hr periods (can be more than 1) 
//      and use the remainder
double trueTimeSpent = timeSpent <= (8 * hour()) ? 
    timeSpent :
    timeSpent % (16 * hour());

// return time spent
traceln("%.2f: returning %.2f", time(), trueTimeSpent);
return trueTimeSpent;
  1. Service需要配置对象来记录每个Agent的进入时间col_startTimeSec集合然后调用f_calcTATsec()退出时的功能,即On enter = col_startTimesSec.put(agent, time()); and On exit = double trueTimeSpentSec = f_calcTATsec(agent);
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Anylogic 中的时间分布和处理所花费的时间 的相关文章

随机推荐