0

I am using AnyLogic 8 University 8.7.0 version and doing Agent Based Modelling. When I create an agent population of Passenger agents, they are being created in FIFO sequence (default behaviour of AnyLogic) but after transitioning through a Branch, the order in which Passenger agents come out changes to LIFO. For my requirement, maintaining FIFO order throughout model execution is critical.

Using a Queue Block (Process Modelling Library) is not possible in my case (from what I have read) since I am primarily doing Agent based modelling and it might not be possible to connect Process Modelling blocks with State Charts (Agent Based Modelling). Another workaround that I tried is to sort the Passenger agents based on a parameter/variable like Passenger_Name but I have not been able to do so successfully.

Any help regarding possible workarounds to solve this issue would be really helpful. Thanks.

  • Can you clarify how you are creating agents? Are you using the database or a source block? Do they all arrive at the same calendar time? When you say transitioning through a branch, do you mean a state chart branch or a process block decide branch? When you say the order the passenger agents come out, what do you mean? The order they enter the next state? – Amy Brown Greer Jan 04 '21 at 16:20
  • Passenger agents are created through an event where I call the method add_passengrs(). Name of passenger agent population is "passengrs". They are created at the same calendar time. By a branch, I mean the state chart branch. Right after this branch, I have a state where these passengers are assigned vehicles. This vehicle assignment is happening in a LIFO way. Before adding this state chart branch, the passenger agents were being assigned vehicles in a FIFO manner (which is what my requirement is). A state chart branch is a necessity since vehicle availability check happens here. – Saumya Bhatnagar Jan 05 '21 at 05:01
  • Does this vehicle assignment happen at time zero? Only at time zero? If not at time zero, how are you "waking up" your agents to tell them to look for a vehicle? – Amy Brown Greer Jan 06 '21 at 13:40
  • Thanks for the response, Amy. When the agents are in a particular state, only then they are being assigned vehicles. I finally managed to combine my agent based model with a Queue block from Process Modelling Library. The example given by AnyLogic developers titled "Epidemic and Clinic with Accumulating Concern" helped me in this. – Saumya Bhatnagar Jan 11 '21 at 05:45

0 Answers0