I've got a boat with capacity 1750 pp, that leaves the port every 2 hours based on a schedule. The passengers arrives at a waiting area, they can leave this area if:
All these conditions are working properly, but since it takes time to get to the dock and due to safety protocols, I want to stop the passengers flow 2 minutes before the departure of the boat, in order to not have passengers not embarked on the dock.
How can I link the boat schedule (named schDepartureBoat1) with passengers Wait block (named waitForBoat1)? At the moment I have the following code in the On enter action of the Wait block:
if(cllBoatDock1.size()>0 && (cllPedOnDock1.size()+cllPedOnBoat1.size()) < 1750) {
waitForBoat1.freeAll();
}
Thank you in advance for your help
Most natural in this case would probably be a "Hold" block downstream of the "Wait" block.
2 minutes before departure, you call myHoldBlock.block()
. No more agents leave the "Wait" block and they will have to stay until the next departure.
Just ensure to call myHoldBlock.unblock()
when the next ship wants boarding to start.