question

Nicolas Mbz avatar image
0 Likes"
Nicolas Mbz asked Felix Möhlmann commented

how to create a SC based on array ?


I have 2 labels. Theses two labels are arrays. The size of the arrays are the same for both arrays. But the size is random.

1675675287631.png


I need a statistics collector that create a row per index of the array and get the value of the arrays.

Table table must be like this :

1675674943141.png

is it possible ?

Thanks in advance

SC_FromArray.fsm

FlexSim 22.2.1
statistic collectorarray
1675674943141.png (14.8 KiB)
1675675287631.png (18.6 KiB)
sc-fromarray.fsm (30.7 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.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

You can create multiple rows per event by returning an array in the "Row Value(s)" field. A row will be created for each entry in the array. In your case it could make sense to use the index values the row will correspond to. So if the arrays on the token have a length of three, you would return [1, 2, 3] as the for values.

Note that it is important to "finish" the rows in this case. Otherwise new events would overwrite the rows with row values that already exist.

You can the use those to assign the correct values from the token labels to the columns.

1675678572603.png

sc-fromarray-fm.fsm


1675678572603.png (20.6 KiB)
sc-fromarray-fm.fsm (624.9 KiB)
· 2
5 |100000

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