Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

"On exit" vs "On at exit" in Anylogic

Few blocks in the Anylogic Process Modeling Library like "Source" have actions like "On exit" and "On at exit". What is the difference between the two?

I was trying to create a simple flow of:

source -> SelectOutput -> Service -> Sink

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The agent being created by source block has a Boolean property "is_vip".
When I assigned agent.is_vip to true or false in the "on exit" action of the source, the routing did not work, but when I moved the logic to "on at exit" of the source block, the routing started working.

>Solution :

There is no question here, but you are correct and that is the difference between the boxes. OnAtExit is evaluated before an agent exits the block. OnExit is evaluated after it left.

If a downstream block like SelectOutput depends on some upstream changes, they will not be registered if done in upstream OnExit as the agent is already in the SelectOutput block.

Always safer to use OnAtExit

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading