简体   繁体   中英

Anylogic - Length of delay based on agent arrival schedule

I am modelling a surgery ward, where 3 different patient types (red patient, blue patient and green patient) are entering based on a schedule. Based on the type of patient they are (red, blue or green) the surgery time varies. Red: 30 min. Blue: 1 hour and Green: 2 hours. I am using a delay block to simulate the surgery time. How do I make it so that the delay time is based on the type of patient that enters?

So for example: the delay time is 30 min. when a Red patient enters the delay block, but 1 hour if a Blue enters?

Thanks!

the patients can be just one agent type with a variable for the type.

then in the delay time you add a function for instance getTypeDelay(agent);

And in the function you do something like

if(agent.type.equals("green") return 5.0;//hours or whatever time is

i hope this guides you

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