敏锐度水平 - 护士 - 任何智能

发布于 2025-02-01 14:46:53 字数 1400 浏览 2 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

明媚殇 2025-02-08 14:46:53

很棒的问题!这是很难实现的逻辑。护士最多被分配给4个人,然后她可以一次服务1个人。

为此,我将在入境时将病人分配给护士。他们将寻找第一位分配不到4人的护士,然后在该护士中“注册”。然后,如果他们需要治疗,您将有患者等待抓住已分配的护士。

  1. 要开始创建一个名为Nurse的新代理,其类型为linkedhashset的变量将存储类型患者的代理。

在代理参数中,请记住将护士设置为资源单位。

  1. 创建护士资源库和护士人群,向护士人口添加新的资源单位

“在此处输入图像说明”

  1. 现在,当患者需要将其分配给护士时,关于您的护士人数。
Nurse availableNurse = findFirst(nurses, e -> e.assignedPatients.size() < 4);
agent.nurse = availableNurse;
availableNurse.assignedPatients.add(agent);

当患者进入过程建模库块时,您可以调用此代码,并将其分配给护士。 (我还向患者添加了一个护士变量,以便患者知道要分配的护士)

  1. 现在,当患者需要抓住护士进行注射或其他一些活动时,它可以知道抓住分配给该护士的NURESE。

Great question! This is a difficult logic to implement. The nurse is assigned to up to 4 people and then she can serve 1 of them at a time.

To do this I would have a patient be assigned to a nurse upon entry. They would search for the first nurse that has less than 4 people assigned and then "register" with this nurse. Then if they need treatment you would have the patient wait to seize the nurse it has been assigned to.

  1. To start create a new agent called nurse, with a variable of type LinkedHashSet that will store agent of type patient.

enter image description here

In the agent parameters remember to set the nurse as resource unit.
enter image description here

  1. Create resource pool of nurses and a population for nurses, adding new resource units to the nurse population

enter image description here

  1. Now when a patient need to assign it self to a nurse do this function on your nurse population.
Nurse availableNurse = findFirst(nurses, e -> e.assignedPatients.size() < 4);
agent.nurse = availableNurse;
availableNurse.assignedPatients.add(agent);

You can call this code when ever a patient enters a process modelling library block where it gets assigned to a nurse. (I also added a nurse variable to the patient so that the patient knows which nurse it is assigned to)

  1. Now when a patient needs to seize a nurse for an injection or some other activity it can know to seize the nurese assigned to it.

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文