Ekaterina
Ekaterina

Reputation: 75

How to trigger the event in AnyLogic and then make it cyclic?

I would like to make the cyclic event. This event periodically calculates some parameters of the model. However, the event should be triggered once by a condition. I have no idea how to do that.

I tried to make the event.reset() at the beginning and then restart it after the appropriate condition is met. enter image description here

However, I received the errors:" agent cannot be resolved to a variable"

If I delete the reset and restart functions for the event, everything will be ok. The event is cyclic and works fine.

The double click on the error shows the stings where the error is occurred (highlighted with red color): enter image description here

Upvotes: 0

Views: 290

Answers (1)

Emile Zankoul
Emile Zankoul

Reputation: 2213

On model start-up, suspend the event by using:

event.reset();

Once the condition you have is met, use:

event.restart();

Upvotes: 1

Related Questions