I need help to calculate the time that Mu is waiting (in object station) move to the track. Mu can move to track by @.insert (track,70) see method move; only if PositionIsFree=true. I cannot use the Resource Statistics of station because it parallel proc object and the mu can be waiting and the station is not blocked. Attached Model that showing the problem.
So, you would like to calculate the cumulated time (or a percentage) when the MU cannot move (because the position is not free). Right ?
To do that you can create a global variable on your frame and call it Cumulate_Blocking_Time.
Your move method will be :
local t0 time := eventController.Simtime ;
waituntil posIsFree=true prio 1;
local t1 time := eventController.Simtime ;
Cumulate_Blocking_Time := Cumulate_Blocking_Time + (t1-t0) ;
So, I hope it helps.