简体   繁体   中英

Anylogic: how to end wait block on schedule, not on timeout

I want a boat to leave the port every 120 minutes, from the start of my model.

The boat arrives on an exponential distribution, it enters in a restricted area (the port) and enters in a wait block in order to embark all the passengers. I tried to use "Enable exit on timeout", but the timeout starts when the boat enters the wait block and I want the boat to respect the scheduled intervals. (I don't care about hour or day, but only about fixed intervals)

I used a schedule block, I removed "Enable exit on timeout" on wait block, but I cannot establish a connection between Schedule and Wait block: for the moment the boat remains at the port and doesn't leave.

Thank you in advance for your help

Disable the "exit on timeout". Boats will now be in the Wait block forever, unless you free them explicitly.

Use the Schedule action code to call myWaitBlock.free(agent) where agent is the boat you want to leave.

If you only have 1 boat in the wait block, it can be myWaitBlock.free(myWaitBlock.get(0)) , else loop across all agents inside it to free whichever boat you want.

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