How do I count the number of agents that passed through a state from the statechart in Anylogic?

270 Views Asked by At

I wanna count the number of agents that passed through a state in a day from the statechart. and then I show them by a plot chart or time stack chart. I define some code in the state. Do they can effect on count the number of agents that passed through this state in a day? How do I count the number of agents that passed through a state from the statechart in Anylogic?

1

There are 1 best solutions below

1
Sjoerd On

You can just count agents by adding a variable and let it count wherever you want to. In this case I added a variable named "countAgents" on main and let it count the number of "myAgents" moving from state to state 1.

Good luck!