Tracked variable minimun exception for 0

Tracked variable minimun exception for 0

raul_vazquez
Not applicable
0 Views
2 Replies
Message 1 of 3

Tracked variable minimun exception for 0

raul_vazquez
Not applicable

[ FlexSim 20.1.3 ]

Hi team,


Im creating a tracked variable in order to track content,max,avg and minimun individually per object and when i tried to get the minimum always is 0. there is a way that the tracked variable provide a the second lower value? could i get the second minimum value? is possible to do it without use the warmup time?

The code below is how I create the variable at reset for several objects using "usercommands" on reset.

treenode labelNode=current.labels.assert("ItemQty");
TrackedVariable.init(labelNode,STAT_TYPE_LEVEL,0);

thanks a lot


0 Likes
Accepted solutions (1)
1 View
2 Replies
Replies (2)
Message 2 of 3

mischa_spelt
Advisor
Advisor
Accepted solution

That 0 that you pass in as the third argument to TrackedVariable.init is the start value. If you initialize it to 0 and only set it to higher values afterwards, the minimum will be 0. If that's not what you want, you should make sure it starts at a higher value.

0 Likes
Message 3 of 3

raul_vazquez
Not applicable

Thanks Mischa

0 Likes