question

Hamed S4 avatar image
0 Likes"
Hamed S4 asked Hamed S4 commented

Collecting stay time of different streams using Statistic Collector

The whole topic of Statistics Collectors is very new to me, so I'm trying to grasp the basics of how it can be best put to use. Here is my question:

I have a number of sources and a number of processors. Each source generates a special kind of product, which is processed by its dedicated processor. And I am trying to calculate the following for each entity:

(time an entity exited its dedicated processor) - (time it exited its source)

I want to calculate the above for all of the entities produced during the runtime of the model, and use the source or processor as a stamp as well. In other words, I want to have a table with the following fields:

Item number, Processed by, Time exited from source, Time exited from processor, Stay time

item number processed by time exited source time exited processor stay time
1 Superior_merged 8:00:1 8:01:00 00:00:5
2 Inferior_merged 8:01:00 8:02:12 00:01:12

So, in the above table, item 1 was created by "superior_stream_merged", went in the "queue_merged", and processed by "superior_merged". Item 2 was created by "inferior_stream_merged", went in the "queue_merged", and processed by "inferior_merged". And so on...

What would be the easiest way to do this in FlexSim 17.2.2?

my-model.fsm

statistics collectorstay time
my-model.fsm (29.2 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Jeff Nordgren avatar image
0 Likes"
Jeff Nordgren answered Hamed S4 commented

@Hamed S4

I'm not sure if you've received an answer to your question yet but here is what I would do. Attached is your model with the changes that I've made.

I added a Global Table called "StatTable" that will keep track of the stats that you specified. I added a Global Variable called "ItemNumber" that I use to created a unique item number for each item produced by either of the two Sources. In the OnModelReset trigger, I set that global variable back to zero.

In the Sources, I added code in the OnCreation and OnExit triggers to save values to labels and to write to the global table. In the Processors, in Process Time field, I added code to save the process time to a label on the flowitem. Then in the OnExit trigger, I added code to write to the Global Table.

That's pretty much it. Is this what you were wanting to do? Will this work for your situation? If you have any questions or problems, please let us know.

Thanks.

my-model-jn1.fsm


my-model-jn1.fsm (30.8 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Hamed S4 avatar image Hamed S4 commented ·

Hi Jeff. This is exactly what I was looking for. Thank you so very much for your time.

0 Likes 0 ·