Collecting stay time of different streams using Statistic Collector

Collecting stay time of different streams using Statistic Collector

hamed_s4
Not applicable
7 Views
2 Replies
Message 1 of 3

Collecting stay time of different streams using Statistic Collector

hamed_s4
Not applicable

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 numberprocessed bytime exited sourcetime exited processorstay time
1Superior_merged8:00:18:01:0000:00:5
2Inferior_merged8:01:008:02:1200: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

0 Likes
Accepted solutions (1)
8 Views
2 Replies
Replies (2)
Message 2 of 3

jeff_nordgren
Not applicable
Accepted solution

@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

0 Likes
Message 3 of 3

hamed_s4
Not applicable

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

0 Likes