Search code examples
javaanylogic

How to end the execution of an Event in AnyLogic?


I am using an Event which is triggered by timeout and cyclic in AnyLogic. After a certain condition is true I want to stop the event from executing asap. It needs to be via code.Something similar to .stop(),.finish() or.cancel().

I tried various instructions that I am familiar with to stop executing codes and so on. None of them worked (which I expected to be honest).


Solution

  • The reset() function does that for you: enter image description here

    And if you want to resume the cyclic event after stopping it above, call event.resume():)