question

Adarsh T avatar image
0 Likes"
Adarsh T asked Jordan Johnson answered

Statistics collector for Combiner

Hello All,

I'm using a statistics collector to collect data from a combiner .

i'm able to collect the total number of Input / Output parts from the combiner.

But I also want to collect the input from only one particular input port of a combiner.

Note : I don't want to use the output from previous station (like sink in this model ).

Please find the attached sample model. (combiner-input-port-statistic-collector.fsm )

Thank you in advance..

FlexSim 19.1.1
statistics collector
· 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.

Braydn T avatar image Braydn T commented ·

@Adarsh T

I have a work around you can use:

What are you doing with the numbers after you collect them? If your combiners combine 6 items and 1 pallet, then you can divide the total number of inputted items by 7. If you want the number of pallets, then that's the number. If you want the number of items, then you can subtract that number from the total. Depending on what you do with the numbers you collect, you would execute that in different places.

There may also be a more elegant way to do this. If anyone has any input, feel free to chime in.

0 Likes 0 ·
Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered

To make the table you want, you need to do two steps. First, you need some way to record statistics per port per combiner. I used a Statistics Collector to do that. It has one row per combiner per port that items enter in, and it counts how many times items come in each port.

Next, you need to have a table that records those values once every hour. To do this, I also used a Statistics Collector. The second Statistics Collector records data every hour. It has a column for time. It also has a column set. A column set lets you specify a list of columns on reset. This way, if you change the number of objects in the group, the stats collector can add another column for that object automatically. So I made one column per combiner per port (just ports 1 and 2). Every hour, each of those columns looks up the the correct value in the first combiner.

combiner-input-port-statistic-collector-vs-time.fsm


5 |100000

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

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Adarsh T commented

Here is a model with a table that shows the input through port 2 of each combiner:

combiner-input-port-statistic-collector-modified.fsm

Here are the steps to making the Statistics Collector:

  1. Add a Timer event that fires at time 0, and does not repeat. Add a label to this event called Combiner, with the value of
    Group("Group1").toFlatArray()<br>
  2. Listen to Group1's OnEntry event. Add a Condition to this event with this code:
    data.port == 2
  3. Add a label to this event called Combiner with this value:
    current
  4. On the Data Recording tab, set the Row Creation Mode to Unique Row Values, and choose Combiner
  5. Add the Combiner column. It should update when the row is added, and have the id of the row value.
  6. Add the Input column. It should update with events. For the value, choose the pickoption for incrementing the current value. Make sure to connect this event to the Input column.

· 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.

Adarsh T avatar image Adarsh T commented ·

Hello Jordan,

Thank you for the solution

I need to collect the results as per attached excel file.

Is it possible to collect by using statistics collector or global tables by using custom code.

Can you please share us the example file or by the updating the same file.

book1.xlsx

0 Likes 0 ·
book1.xlsx (8.6 KiB)