I have two agent flows (normal and priority patients), I want to measure their time distribution of staying in the queue before getting up to the floor.
I have tried the followings.. (see images), but none of them work (I got errors saying agent not pass through corresponding TimeMeasureStart).
measure one of them at a timeenter image description here
Two TimeMeasureStart and 2 TimeMeasureEnd
The only way works is this:
2 TimeMeasureStart and 1 TimeMeasureEnd
But this way I can not get the individual time distribution in queue for each group as desired…
I am new to Anylogic and have searched answers for similar questions such as:
- Anylogic – Measuring time through multiple layers of a model,
- Agent time-in-state statistics
- Different delay time for different agents in Anylogic
But I have trouble connecting dots and can’t figure out what to do..Will appreciate any help to shed some light on this. Thank you!
KTH is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Measure it individually in the agent type:
- add a variable
v_Timer
into yourPatient
type - do the same for a variable
v_TimeInQueue
- in the “on enter” of the queue, type
agent.v_Timer=time();
- in the “on exit” of the queue, type
agent.v_TimeInQueue = time()-v_Timer;
Now each agent “knows” it time in the queue via the v_TimeInQueue
. You can cut and slice this any way you like
PS: This assumes you have 1 agent type Patient
that flows through the flow chart