Tracked variables

Tracked variables

myriam_srdg
Not applicable
17 Views
6 Replies
Message 1 of 7

Tracked variables

myriam_srdg
Not applicable

[ FlexSim 22.1.0 ]

Hello,

I'm using tracked variables in a model and I've realized that they restart when the warm-up period arrives. Is there any way to avoid this?

Thank you!
Myriam

0 Likes
Accepted solutions (1)
18 Views
6 Replies
Replies (6)
Message 2 of 7

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

You can store the nodes of the variable as a copy somewhere else before the warmup time ends. Then after this event you transfer the nodes back.

EDIT: Thanks for pointing this out. @Mischa Spelt

The warmup mechanism has not got an exclusion feature or a mapping of options.

A static method named init(…) has the ability to exclude resetting values from warmup option by setting a flag called: STAT_IGNORE_WARMUP

the tracked variable will ignore the resetstats() command. Use this option only if the tracked variable should keep the data collected during warmup time.

0 Likes
Message 3 of 7

mischa_spelt
Advisor
Advisor

The warmup mechanism has not got an exclusion feature or a mapping of options.

But Tracked Variables can have a STAT_IGNORE_WARMUP flag, right?

Message 4 of 7

joerg_vogel_HsH
Mentor
Mentor
@Mischa Spelt, you are right. It is a valid flag option in FlexScript Class Reference API.
0 Likes
Message 5 of 7

myriam_srdg
Not applicable

Oh that's awesome. Thanks @Mischa Spelt and @Joerg Vogel .

I guess this is the code that I need to use. 1649231187667.png

But I'm not sure where do I have to introduce it. Can you help me with this?

Thank you! )

Myriam

0 Likes
Message 6 of 7

joerg_vogel_HsH
Mentor
Mentor

tracked-variable-warmup-ignore.jpgtracked_variable_warmup_ignore.fsm

I executed the init line from a script window. Then the flag has been set and it will be kept set all time until it get erased by bit logic operation. If you dont have access to a script console, execute the code line once from a trigger or custom source code activity in process flow. Please compare entries of trackedvariable1 and 2. The time is not reset by warmup time. I'm not aware of an option to update time on warmup, too.

TrackedVariable.init(TrackedVariable("TrackedVariable1"),
STAT_TYPE_TIME_SERIES,0,STAT_USE_HISTORY | STAT_IGNORE_WARMUP) 

I write same values for both tracked variable on exit trigger to them.

Message 7 of 7

myriam_srdg
Not applicable
Thank you @Joerg Vogel

I managed to do it ))


0 Likes