question

Briankuo avatar image
0 Likes"
Briankuo asked Natalie White commented

How to change the label by time?

Hi, I would like to change the label by time.

In detail, items are generated by source with labels(duniform 1 to 4).

When the item was transported into the rack, it begins to count the time how long the items stay in the rack.

Every 24 hours past, the label of the item will plus 1 ,until it reach 4 (the maximum).

Please help me to solve it. Thanks a lot!


FlexSim 22.0.16
labelstime
· 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.

Julie Weller avatar image Julie Weller commented ·

Hi @Briankuo! Have you looked at this question?

https://answers.flexsim.com/questions/144761/if-it-is-possible-to-add-a-label-to-items-accordin.html?childToView=144764#answer-144764

You could also use process flow and a date/time source to change the label or use some custom code to check if the token label should be changed. It might be helpful to post a model if you want more specific help!

0 Likes 0 ·
Natalie White avatar image Natalie White commented ·

Hi @Briankuo, was Jason Lightfoot'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 comment back to reopen your question.

0 Likes 0 ·

1 Answer

Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Jason Lightfoot edited

An alternative to creating events to change the label over time is to just calculate the age when you need it:

Math.floor((time()-stats_lastmovetime(item).value)/days(1))
· 10
5 |100000

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

Briankuo avatar image Briankuo commented ·
After calculating the age, how can i change the label? Besides, i don't want my label value exceed 4.Thanks!
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Briankuo commented ·
int numdays =(time()-stats_lastmovetime(item).value)/days(1);
return Math.min(4,numdays);

Which you may be able to add as an expression in a list replacing 'item' with 'value'.

0 Likes 0 ·
Briankuo avatar image Briankuo Jason Lightfoot ♦♦ commented ·

Sorry for don't getting it.Could you tell me how to update the label "Type" with value of age in GlobalList specifically?

0 Likes 0 ·
Show more comments