question

Rahul R avatar image
0 Likes"
Rahul R asked Rahul R answered

Tracked variable - categorical type

I have added a categorical type tracked variable to track state. I am assigning different states like "Idle", "Traveling", "Charging" etc. When I try to refer to this label or print it out, I see integer values instead of string. I am assuming flexsim is keeping a distinct integer to track each state. Is there a way for me to access the original string value or see the mapping ?

FlexSim 21.2.4
statetrackedvariablecategorical
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

Rahul R avatar image
0 Likes"
Rahul R answered Rahul R edited
TrackedVariable tState = current.labels["state"];
string name = tState.getCategoryName(current.state);
print (name);
5 |100000

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