Reputation: 1
Two groups of men and women arrive at the same entrance source at the same time to avail a certain service, then how can we get the entire average waiting time of both separately in anylogic .please help me.
Upvotes: 0
Views: 347
Reputation: 1636
You can use these two block provided by AnyLogic.
Or as I do, create two variables for your agents called enterTime
and leaveTime
and set them to time()
when they enter and leave the Queue. Like agent.enterTime = time()
. Create a variable in the Main (assuming your blocks are there) called totalTimeInQueueMen
and totalTimeInQueueWomen
and set it to totalTimeInQueueMen=totalTimeInQueueMen+(agent.leaveTime-agent.enterTime)
. Also count your number of agents with a variable called count
. Every time they enter the queue, increment it by 1; like count+=1;
. At the end of the the simulation you can calculate the average as totalTimeInQueueMen/count
(the same for women).
Upvotes: 1