Anylogic: Time Measurement by condition

Viewed 57

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

1 Answers

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

Related