ana
ana

Reputation: 1

calculate avarage waiting time in anylogic

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

Answers (1)

Yashar Ahmadov
Yashar Ahmadov

Reputation: 1636

You can use these two block provided by AnyLogic.

enter image description here

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

Related Questions