如何防止服务块启动 [英] How do I prevent service block from starting

查看:87
本文介绍了如何防止服务块启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Anylogic的新手,我想知道是否有可能在轮班结束前保留延迟流程(如果该流程已经开始).

I'm new to Anylogic, and I was wondering if it's possible to hold delay process when the shift is over eve if the process already started.

我正在尝试在服务操作中编写一些代码,但找不到正确的代码行.

I'm trying to write some code in the service action but i don't find the correct code lines.

我希望流程停止,直到下一次资源转移开始为止.

i expect the flow process should stop until the next resource shift will start.

推荐答案

您可以使用服务块中的自定义资源选择来做到这一点:

You can do that using the custom resource choice in the service block:

self.delayTime(agent)<schedule.getTimeoutToNextValue()

这意味着仅当该代理的延迟时间小于下一个计划事件的时间时,才可以选择资源.

This means that a resource can only be chosen if the delay time for that agent will be smaller that the time for the next schedule event.

如果您对模型中的时间单位的工作方式有疑问,可以放心使用,如果延迟时间以小时为单位,则可以像这样明确地定义时间单位.

If you have doubts on how time units are working on your model, you can play safe and explicitly define the time units like this if the delay time is in hours.

self.delayTime(agent, HOUR)<schedule.getTimeoutToNextValue()

请确保您的模型时间以小时为单位,因为将根据模型中使用的时间单位来定义函数getTimeoutToNextValue.

Be sure that your model time is in hours, because the function getTimeoutToNextValue will be defined depending on the time units you are using in your model.

这篇关于如何防止服务块启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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