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

Anylogic: Time Measurement by condition

I use several TimeMeasureStart and TimeMeasureEnd blocks in my model. Now I would like to set a condition that the TimeMeasureStart only starts measuring the time of an agent, if a certain condition is true. For example: If variable var1 == 1. In this case, var1 is a variable outside of the agent. Is it possible to set a condition "on enter" of the TimeMeasureStart block like in the screenshot below? I don’t know how to replace the "????" in the condition.

enter image description here

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

>Solution :

No, you should simply bypass theTimeMeasureStart block with a SelectOutout block upstream that filters agent by the condition you need:

enter image description here

In the SelectOutput condition, you define your condition similar to below (here, if var1==1 agents would be measured):
enter image description here

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