Page 1 of 1

Age of Product

Posted: Wednesday 29 July, 2015 - 20:31
by EikeB
Hey,

I would like to see the Age of an Product that runs through my system. I know i could use Age(i) but the Problem is that Products wait in a Queue before they enter the "real" System and i don't want that waiting time.

Is there a way to set the Age back to 0 when the Products exit the Queue or an alternative possibility ?

Re: Age of Product

Posted: Thursday 30 July, 2015 - 09:48
by HarryBunnik
Ha EikeB,

No, you can't set the Age of an atom to 0. I would suggest you use a label, which you set on the product itself, to keep track of the age of your product. So something like

Code: Select all

Label([AgeOfProduct], i) := time

on the OnExit of the queue and use that same label on the OnEntry of your Sink (or any other point where the product is passing, to calculate it's age.

Code: Select all

Time - Label([AgeOfProduct], i)
I hope this helps you further,

Cheers,

Harry