question

shanice.c avatar image
0 Likes"
shanice.c asked Connor A commented

How to use statistics collector to record token label value in onEntry activity?

I have written model.time to two different token labels, and I hope I could write down the token label value when token on entry each activity, at the same time calculate the time between start and ends in third column. I test another example from this forum, I found that there's no problem if the value I'm recording in statistics collector is a label value. Now I try to record the time information, then there's red triangle on left top of a cell, may I ask what this means?

test collect token time.fsm

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

1 Answer

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

The data you are trying to read doesn't exist (yet), that's why you are seeing empty cells with the red mark in the corner. Because you listen to the entry event of the assign activities, the labels you are creating in them don't exist yet, when the statistics collector is triggered.

Instead of assigning the time to label values, you can get the current model time with "Model.time" and assign that value to the cell in the collector.

You also probably want to use a "Row Value". By defining "data.token" as row value, the collector will first check whether a row already exists for that value (the token). If that's the case, no new row will get created, instead the existing one will get updated.

test-collect-token-time_1.fsm


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