基于优先级的队列在AnyLogic中的应用

huangapple go评论100阅读模式
英文:

Priority-based queueing in AnyLogic

问题

我是AnyLogic的新手,正在为一个真实的急诊科制作模型。我已经几乎完成了所需的一切,但是在优先级排队方面遇到了问题。在我们的模型中,患者有两种不同的优先级(红色和黄色),其中红色在排队时具有更高的优先级。例如,如果一个黄色优先级患者和一个红色优先级患者都在排队等待进行X光检查,应该先选择红色优先级患者(基于优先级的排队,而非后进先出)。

我看到了很多解释如何实现这一点的帖子,但是它们对我都没有起作用。我尝试在“患者”代理中创建一个名为“priority”的参数,并在SelectOutput的退出处使用“agent.priority=1;”来指定优先级,然后在Queue中选择“基于优先级”的选项,但似乎并没有起作用,我收到以下错误:

队列优先级

输出优先级

错误信息

我还尝试将“patient.priority=2;”替换为“agent.priority=2;”,还尝试使用变量而不是参数,还尝试使用以下公式初始化变量的值:uniform() < 0.7 = 1 : 3。但都没有起作用。

有谁知道如何使用基于优先级的排队,或者我可以使用的某种解决方法吗?这是我成为工程师的最终项目!

我使用的版本是AnyLogic Professional 7.0.2

非常感谢您的时间!

英文:

I'm new in AnyLogic and I'm developing a model for a real Emergency Department. I have developed almost everything I need, however I'm having trouble with priority queueing. In our model we have 2 different priorities for patients (red and yellow), where red has a higher priority in queueing. For example, if a yellow-priority patient and a red-priority patient are both in queue for going to the X-ray, the red should be picked first (Priority-based queueing NOT LIFO).

I saw a lot of posts that explained how to do this but none of them worked for me. I tried making a parameter called "priority" within the "Patient" agent and using "agent.priority=1;" for assigning priorities on the exit of a SelectOutput and then selecting the "Priority-based" option in the Queue but that doesn't seem to work as I get the following error:

Queue priority

Output priority

Errors

I also tried typing "patient.priority=2;" instead of "agent.priority=2;", also using a variable instead of a parameter, and also initializing the variable's value with the following formula: uniform() < 0.7 = 1 : 3. But this didn't worked.

Does anyone know how to use priority-based queueing or some sort of walkaround I could use? It's for my final project for becoming an engineer!

The version I'm using is AnyLogic Professional 7.0.2

Thank you very much for your time!

答案1

得分: 1

你正在使用一个非常旧的AnyLogic版本,该版本仍然使用旧的过程建模库,其中实体并不是真正的代理。你可以尝试使用entity代替agent

在导致错误的字段(您输入了agent的地方),当光标位于字段中时,是否有一个小的“灯泡”?如果有的话,它允许您编写哪些关键字?请参阅这篇文章以了解我在谈论什么。

强烈建议您尽快升级 基于优先级的队列在AnyLogic中的应用

英文:

You are using a very old AnyLogic version that still applies the old process-modelling library where entities are NOT actual agents. Instead of agent you could try entity.

In the fields causing the errors (where you typed agent), is there a small "lightbulb" when you have the cursor in the field? If so, what keywords does it allow you to write? Please see this article to understand what I am talking about

Strongly suggest you upgrade asap 基于优先级的队列在AnyLogic中的应用

huangapple
  • 本文由 发表于 2020年10月9日 09:27:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/64272747.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定