简体   繁体   中英

Anylogic - sending message from seize to agent in DES-ABM model

In a hybrid DES-ABM model I've been building in Anylogic 8, I'm struggling with sending messages. In main, there are several clinics, and within these clinics the process modeling library is used to model within clinic processes. Once the patient-agent reaches a 'seize' block, a doctor-agent is seized.

Now, what I am trying to do is, once that doctor-agent is seized, a message needs to be sent from that 'seize' block to the doctor-agent that lives in the clinic.

I've consulted the Anylogic Help manual, and I have inserted these code snippets at the 'seize' block, in the 'On entry' field:-

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).

How would I do this?

You need to send the message in the "onSeize" code section of the seize block. There, type:

send("Start", unit)

The keyword "unit" will send it to the doctor that has been seized. Read more about those keywords and where to find them here:

http://www.benjamin-schumann.com/blog/2016/2/4/the-magic-lightbulb-and-how-it-can-help-your-anylogic-modelling

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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