简体   繁体   English

如何使用抢占块

[英]How to use preempt for seize blocks

I am currently building a model on a manufacturing process line.我目前正在制造生产线上构建 model。 The intention is to create a model with multiple machines and operators.目的是创建一个具有多个机器和操作员的 model。 An operator is seized at multiple points for performing various taskings.操作员在多个点被抓住以执行各种任务。 However, I require operators to follow a certain work schedule and go for breaks at staggered timings.但是,我要求操作员按照一定的工作时间表和 go 错开时间休息。 As such, I have created the schedule within each agent to customise their break times.因此,我在每个代理中创建了时间表以自定义他们的休息时间。

The problem that I am faced with is I need the operator to suspend his/her current tasking whenever its time for break.我面临的问题是我需要操作员在休息时间暂停他/她当前的任务。 Hence, I have been exploring the preempt feature within the seize block, but have failed to get what I require.因此,我一直在探索 seize 块中的抢占功能,但没有得到我需要的东西。

I'll illustrate an example below.我将在下面举例说明。 Assuming that the operator is performing the current task of "receiveLot_V", while at this task, it is time for break.假设操作员正在执行“receiveLot_V”的当前任务,而在这个任务中,是休息时间。 Upon break time, the schedule triggers to enter the flowchart to seize the current operator for break (I need to capture the duration where each operator is at break and at the same time not allow the operator at break to be available in the resource pool to be seized elsewhere).在休息时间,调度触发进入流程图以获取当前操作员休息(我需要捕获每个操作员休息的持续时间,同时不允许资源池中休息的操作员可用以在别处查获)。

I have allowed the seize block for break to have a higher task priority, however the operator just stays at the current position and does not seem to proceed with the process flow for break after he/she is being seized.我已经允许 break 的 seize 块具有更高的任务优先级,但是操作员只是停留在当前的 position 并且在他/她被 seized 之后似乎没有继续 break 的流程。

In addition, for certain taskings I am sending my operator to a particular node upon seizing to perform a tasking.此外,对于某些任务,我会在抓住执行任务时将我的操作员发送到特定节点。 While the operator is moving and the breaktime hits, I face an error as shown in the last image.当操作员移动并且休息时间到了时,我遇到了最后一张图片所示的错误。 root.pop_DirectOperators[0].enter refers to the process flow within the operator to be seized for break, and root.pop_Equipments[0].seizeDO.sendTo refers to the process where the operator is being sent to a particular node to perform his/her tasks. root.pop_DirectOperators[0].enter 指的是 operator 中的流程流,root.pop_Equipments[0].seizeDO.sendTo 指的是将 operator 发送到特定节点以执行其操作的过程/她的任务。

How can I resolve this issue?我该如何解决这个问题? Am I understanding the preempt feature wrongly?我是否错误地理解了抢占功能? I've tried multiple combinations of settings with the preempt but none of them seems to work for my case.我已经尝试了多种设置组合与抢占,但它们似乎都不适用于我的情况。

代理当前任务

操作员休息时间

当前任务的操作员设置

错误信息

It sounds like you're trying to use a separate process to represent the breaks, which is one (uncommon) alternative (see below).听起来您正在尝试使用一个单独的过程来表示中断,这是一个(不常见的)替代方案(见下文)。 The error suggests you are sending the resource agent into that process instead of a dummy agent which represents the 'break request' (and which will then seize the appropriate resource agent to take its break).该错误表明您正在将资源代理发送到该进程,而不是代表“中断请求”的虚拟代理(然后它将占用适当的资源代理以中断)。

The typical ways of modelling pre-empting breaks are:对抢先休息建模的典型方法是:

  • Set up breaks specified by the Resource Pool properties (ensuring they have a higher priority than that for agents which seize those resources).设置由资源池属性指定的中断(确保它们具有比占用这些资源的代理更高的优先级)。 This works fine if your breaks have a fixed schedule of occurrence.如果您的休息有固定的发生时间表,这会很好用。 Then have pre-emption occur in all Service/Seize blocks that you want to be affected by break pre-emption.然后在您希望受中断抢占影响的所有服务/占用块中发生抢占。

  • As above but use a Downtime block to specify the pattern of breaks.如上所述,但使用 Downtime 块来指定中断模式。 Gives a bit more flexibility in how breaks are specified but still only within the limits of what a Downtime block can specify.在如何指定中断方面提供了更多的灵活性,但仍然只在停机时间块可以指定的范围内。

  • For a completely 'custom' situation (where, for example, breaks might need to be determined dynamically for indivividual resource units in some way), use a separate process flow to 'cause' the breaks: inject agents representing the break request (so eg, of custom type BreakRequest ) into the process which seize the appropriate resource from the appropriate pool (where this injection could be driven from behaviour within the individual resource unit agents themselves), and model the ensuing break in whatever way is needed (eg, just a plain Delay or something more complex that determines when their break will end).对于完全“自定义”的情况(例如,可能需要以某种方式为单个资源单元动态确定中断),使用单独的流程来“引起”中断:注入代表中断请求的代理(例如, 自定义类型BreakRequest ) 进入从适当的池中获取适当资源的过程 (这种注入可以从单个资源单元代理本身的行为驱动), 和 model 随后以任何需要的方式中断 (例如, 只是一个普通的延迟或更复杂的东西来决定他们的休息时间何时结束)。 You need to ensure that the break request agent has a higher priority than other tasks (ie, other agents flowing into other Service/Seize blocks) and is set to pre-empt.您需要确保中断请求代理的优先级高于其他任务(即其他代理流入其他 Service/Seize 块)并设置为抢占。

The important things to understand are:需要了解的重要事项是:

  • You specify "Task may preempt" on the blocks where the tasks that will pre-empt others (if higher priority) occur (ie, you specify this on the Service/Seize blocks of the 'pre-empters').您在将抢占其他任务(如果优先级更高)的任务发生的块上指定“任务可能抢占”(即,您在“抢占者”的服务/占用块上指定此)。

  • You specify "Task preemption policy" on the blocks where the tasks that will be pre-empted occur (ie, you specify this on the Service/Seize blocks for the 'pre-empted').在将被抢占的任务发生的块上指定“任务抢占策略”(即,您在“抢占”的服务/占用块上指定此)。 And then you have the specified options in terms of what to do with the task (agent) that has been 'kicked out'.然后你有关于如何处理被“踢出”的任务(代理)的指定选项。 If you specify "No preemption" then the pre-emption won't happen even if the 'source' task is set to pre-empt and has a higher priority.如果您指定“无抢占”,那么即使“源”任务设置为抢占并具有更高的优先级,抢占也不会发生。

  • Priorities are 'global' (eg, if you say in a special breaks process flow Seize block that the incoming agent has priority 100, then the seize request that it then sends to the relevant resource pool will be compared against the priorities of all other tasks those resource agents are doing or have been asked to do, which are determined from whatever Seize/Service block they arrived in originally).优先级是“全局”的(例如,如果您在特殊的中断流程流程中说传入代理的优先级为 100,那么它随后发送到相关资源池的占用请求将与所有其他任务的优先级进行比较这些资源代理正在做或已被要求做,这是根据他们最初到达的任何 Seize/Service 块确定的)。

Your screenshots suggest you haven't set up the pre-emption block options on the correct blocks (as well as possibly/probably sending the wrong agent into your special breaks flow);您的屏幕截图表明您没有在正确的块上设置抢占块选项(以及可能/可能将错误的代理发送到您的特殊中断流中); see info above.见上面的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM