Anylogic - 在 DES-ABM 模型中将消息从 seize 发送到代理
Anylogic - sending message from seize to agent in DES-ABM model
在我一直在 Anylogic 8 中构建的混合 DES-ABM 模型中,我正在努力发送消息。主要有几个诊所,在这些诊所内,流程建模库用于在诊所流程内建模。一旦患者代理到达 'seize' 块,医生代理就会被抓住。
现在,我要做的是,一旦抓获该医生代理,就需要从那个 'seize' 块向住在诊所的医生代理发送一条消息。
我查阅了 Anylogic 帮助手册,并在 'seize' 块的 'On entry' 字段中插入了这些代码片段:-
agent.send("Start", Clinic.doctor)
send("Start", Clinic.doctor)
Error: Description: Cannot make a static reference to the non-static field
agent.send("Start", doctor)
send("Start", doctor)
Error: Description: The method send(Object, Agent) in the type Agent is not applicable for the arguments (String, Clinic._doctor_Population).
我该怎么做?
您需要在占用块的 "onSeize" 代码部分发送消息。在那里,输入:
send("Start", unit)
关键词"unit"会发给被检的医生。在此处详细了解这些关键字以及在哪里可以找到它们:
在我一直在 Anylogic 8 中构建的混合 DES-ABM 模型中,我正在努力发送消息。主要有几个诊所,在这些诊所内,流程建模库用于在诊所流程内建模。一旦患者代理到达 'seize' 块,医生代理就会被抓住。
现在,我要做的是,一旦抓获该医生代理,就需要从那个 'seize' 块向住在诊所的医生代理发送一条消息。
我查阅了 Anylogic 帮助手册,并在 'seize' 块的 'On entry' 字段中插入了这些代码片段:-
agent.send("Start", Clinic.doctor)
send("Start", Clinic.doctor)
Error: Description: Cannot make a static reference to the non-static field
agent.send("Start", doctor)
send("Start", doctor)
Error: Description: The method send(Object, Agent) in the type Agent is not applicable for the arguments (String, Clinic._doctor_Population).
我该怎么做?
您需要在占用块的 "onSeize" 代码部分发送消息。在那里,输入:
send("Start", unit)
关键词"unit"会发给被检的医生。在此处详细了解这些关键字以及在哪里可以找到它们: