简体   繁体   English

Anylogic - 基于代理到达时间表的延迟长度

[英]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.我正在模拟手术病房,其中 3 种不同的患者类型(红色患者、蓝色患者和绿色患者)根据时间表进入。 Based on the type of patient they are (red, blue or green) the surgery time varies.根据患者的类型(红色、蓝色或绿色),手术时间会有所不同。 Red: 30 min.红色:30 分钟。 Blue: 1 hour and Green: 2 hours.蓝色:1 小时,绿色:2 小时。 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.例如:延迟时间为 30 分钟。 when a Red patient enters the delay block, but 1 hour if a Blue enters?当红色患者进入延迟块时,但如果蓝色患者进入则为 1 小时?

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);然后在延迟时间添加一个函数,例如 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我希望这能指导你

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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