Cancel
Showing results for 
Search instead for 
Did you mean: 

To calculate waiting time of Transporter

Experimenter
Experimenter

Hello Everyone,

 

I have attached the model, where I am trying to find out the actual waiting time of the Transporter on the track.

 

I have added a method, where the time difference is calculated.

But I am unable to figure out why waiting time is not calculated. Any guidance will be helpful.

 

Thanks

Ani

1 REPLY 1

Re: To calculate waiting time of Transporter

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

this should work:

 

if @.stopped= True then
	X:= EventController.simTime;
	waituntil  @.stopped= false prio 1;
	Y:= EventController.simTime;
	
	waiting_time:=Y-X;
    New_table[1, New_table.yDim+1]:= waiting_time;
end;

the problem is, if the transporter is stopped, it will never reach sensor 2, or if the transporter crosses sensor 2, it will not be stopped.
There is an statistical value for the waiting time on a track for the transporter: statTranspWaitingTime (see help), this shows the waiting time without any programming

 

Steffen Bangsow
freelance simulation specialist  
web: www.bangsow.eu
mail: steffen@bangsow.net