question

Patrick Cloutier avatar image
0 Likes"
Patrick Cloutier asked Eric M answered

Stats Collector: How to reference previous row data when adding a row

In the very simple attached model I'm trying to calculate the time between part arrivals using a stats collector.

So 1st column is arrival time. 2nd column needs to be arrival of previous row. And then 3rd column will be 2nd column - 1st column.

But I can't figure out how to reference the previous row data in the "Row Add Value" field of the 2nd column.

Is that possible?

StatscollectorPC.fsm

FlexSim 21.1.5
flexsim 21.1.5stats collector
statscollectorpc.fsm (566.4 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

·
Eric M avatar image
0 Likes"
Eric M answered

Hi @Patrick Cloutier, you can use the stats collector as a table which comes in handy. You can use code like this in the row add / event value to get the previous row's data:

collector.as(Table)[data.rowNum - 1]["desired column"]

You can do something similar to subtract the 2 columns from each other in your 3rd column.

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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