Search code examples
anylogic

AnyLogic Measure time in the system for each arrival stream


I have a flow chart like below. Current flow chart

my current tmE_SystemA measured time in the system for a customer, regardless of their arrival stream. However, I also would like to know the time for a customer in the system for each arrival stream.

I tried to add 3 more Time Measure End before the current tmE_SystemA and each measure for one tmS_A. But it will gives me error when customer from other streams reach to the new Time Measure End (e.g. when customer from customerArrival_A2 reached tmE_A1 it will show error, saying that this agent not pass through corresponding Time Measure Start.)

So how can I properly measure the time for each arrival stream?


Solution

  • Instead of timeMeasureStart and timeMeasureEnd blocks, you can just add variables inside your Customer agent called startTime, endTime and cycleTime of type double.

    Then, at endService, you can type agent.cycleTime=agent.endTime-agent.startTime;. You will have the time in system for each agent.

    enter image description here