[英]Assign priorities for multiple Seize Blocks for the same resource in AnyLogic
I have a not so typical scenario for which I am not sure how to proceed:我有一个不太典型的场景,我不确定如何进行:
My concern is that there might be a situation where both stations have agents waiting in their respective seize blocks.我担心可能会出现两个站点都有代理在各自的占用块中等待的情况。 How can I make sure the resource will be seized by station 1's seize element and not station 2's, and vice versa.
我如何确保资源将被站点 1 的占用元素占用而不是站点 2 的元素,反之亦然。 Is there a way to control where the resource is going in a case where two seize elements are waiting for it?
在两个 seize 元素正在等待资源的情况下,有没有办法控制资源的去向? Or is it always random?
还是总是随机的?
I apologize for the long post, and I hope I managed to deliver my idea properly.我为这篇长文章道歉,我希望我能正确地表达我的想法。
First, I think your design is a bit weird because you keep the resource always seized.首先,我认为你的设计有点奇怪,因为你总是抓住资源。
What I would do is first have a statechart in the resource that controls the resource movement from one place to the next so you have more control over it.我要做的是首先在资源中有一个状态图来控制资源从一个地方到另一个地方的移动,这样你就可以更好地控制它。 The statechart would be used to move your resource ONLY when it's not seized.
状态图仅在未被占用时用于移动您的资源。 This will allow a case in which your resource is moving from station 1 to station 2 but something comes to station 1 queue and the resource can immediately react and come back to station 1 before it reaches station 2 (if you think it would be a good idea to do that)
这将允许您的资源从站 1 移动到站 2 但有东西进入站 1 队列并且资源可以立即做出反应并在到达站 2 之前返回站 2(如果您认为这是一个好这样做的想法)
The second is that the seize block defines the priority for a task when the agent arrives to the seize block, and your situation requires changing that priority dynamically, which can't be done as far as I know, so the wait block before the seize block is unfortunately a good option.第二个是seize块定义了当agent到达seize块时任务的优先级,你的情况需要动态改变该优先级,据我所知这是无法做到的,所以在seize之前的wait块不幸的是,阻止是一个不错的选择。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.