Column capturing label of token on stats collector

Column capturing label of token on stats collector

lenny_c1
Not applicable
48 Views
3 Replies
Message 1 of 4

Column capturing label of token on stats collector

lenny_c1
Not applicable

[ FlexSim 20.1.3 ]

Hi,

I would like to have an additional column on my zone's (Track WT) stats collector to capture the step value (token label) of my patients. May i know how i can go about doing it? thank you!


Training_Model.fsm

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

moehlmann_fe
Explorer
Explorer
Accepted solution

The "OnStayTimeChange" event does not hold any information about the token/object that caused the change. (As far as I know, because the staytime is implemented as a tracked variable, whose change might not be tied to any object at all.)

You will have to use a different event to determine the timings. A simple solution would be to listen to the "OnEntry" and "OnExit" events of the "EnterZone" and "ExitZone" activities respectively.

I added to example collectors to your model. In the first (StayTime_OnExit_WithLabel), I only listen to tokens exiting the zone. The entry time is written to a token label right before they pass into the zone and later used to calculate the staytime.

The second (StayTime_FromEntryToExit) listens to both entry and exit. On entry the "StayTime" column gets used to store the entry time. When the tokens exits, this value is then used together with the current model time to calculate the staytime. In this case a "rowValue" is necessary to know which exit event belongs to which entry. I use the token reference from the events for this. Also note how the "Finish involved rows after this event" is unchecked for the entry event, because the row will need to be updated later.

In both cases, because the events possess a reference to the token, the "step" label can be easily accessed and assigned to a column value.

Apart from the first one needing an extra process flow activity, the difference between these two options is in what order the rows will be generated. In the first case, the rows will be ordered by the time the tokens exit the zone. In the second, by the entry time.

training-model_fm.fsm

0 Likes
Message 3 of 4

ryan_c10
Not applicable

Hi @Lenny C, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes
Message 4 of 4

lenny_c1
Not applicable
Thank you!


0 Likes