I have three sources that create agents and then flow into a queue. All three sources create different agents.
My idea is to assign an ID (numerical value of int) to each created agent in each source at "Actions – On before Arrival". The ID should be unique. So it should be prevented that the sources generate the same ID .
All ID coming from source 1,2,3 should be stored in the queue in a list after FIFO and output. To do this, I want to create a variable that can then store and output all the ID created.
Can someone help me and find a suitable code for the "source" which assigns an ID to each agent?
I have not managed to find a code that satisfies this property.
Add a variable of type
counter next to the sources. In each source’s "on at exit" code box, write:
this assumes all your agents created by the sources have a parameter of type
With this universal counter, you will get unique ids.