Anylogic: StopDelay() is not working due to which agent is not able to leave the Delay block

Viewed 28

StopDelay() is not working due to which agent is not able to leave the Delay3 block. enter image description here

1 Answers

of course your stopDelay won't work because no agent ever reaches delay4

delay3 REQUIRES a call for stopDelay, but there's nothing doing that since the only time stopDelay is called, is further in the flow.

What you need to do instead is on the on enter action of the delay3:

if(delay4.size()==0){
    delay3.stopDelay(agent);
}

and on the on exit of the delay4 you do:

if(delay3.size()>0){
    delay3.stopDelay(delay3.get(0));
}
Related