To count the number of agents that have exited a block through a particular port, use the count() function on that port. For example, if your model contains a Source block and you want to know how many agents have left through its output port out, use the following code: source.out.count().
To find out the name of a port, see the block descriptions in library reference guides. Port names are shown in the block figure at the top of each page:
The block and port names in the documentation
During simulation, AnyLogic displays statistics on agent throughput through the flowchart blocks using text labels near the block icons.
- The number at the top of a block icon indicates how many agents are currently inside the block.
-
The numbers next to ports show how many agents have passed through those ports since the simulation started.
To toggle the port and block counters, click the small triangle in the upper left or upper right corner of the block:
You can also enable or disable all counters globally in the AnyLogic preferences.
-
How can we improve this article?
-