How to determine costs for the service time and idle time in a queuing problem in anylogic?

459 Views Asked by At

I need to simulate a simple M/M/1 problem in Anylogic. So far, I created the model and calculated all performance measures like the average time in queue and system and the average number in queue and system. Now I need to calculate the Total Costs. The painting time for a car would be 6 hours and costs $70 per hour. The cost of idle time per car is $100 per hour. The cars arrive according to a Poisson process with a mean rate of 1 every 5 hours. Can someone help me how I can calculate the total costs in this model in annylogic?

enter image description here

1

There are 1 best solutions below

0
On

Refer to this question about measuring time: Method the measure the time an agent is not in use during a simulation

You need to create an agent type that has variables for time and cost. Then on the On Enter and On Exit fields, record time and cost for individual agents. Once you have measured time, cost is simply time multiplied by the hourly cost.

If you want to measure total cost, you can create variables in main such as totalCost and the code of the sink's On Enter would be:

totalCost += agent.totalCost

Where the second totalCost variable would be the variable inside the agent type.

Anyway, the above should give you a good idea on how to proceed...