Queue sequence

Queue sequence

CJY3
Not applicable
374 Views
3 Replies
Message 1 of 4

Queue sequence

CJY3
Not applicable

[ FlexSim 18.0.10 ]

To assign a sequential number to an object when enqueuing it, and decrement the sequential numbers of subsequent objects as the frontmost object is dequeued in a queue.

How should I set up this logic?

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

joerg_vogel_HsH
Mentor
Mentor
Try it with array arithmetic.

new objects get a value of array length + 1,

leaving objects decrement each element by 1.

0 Likes
Message 3 of 4

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

Use rank property of treenode Flexscript class api.

0 Likes
Message 4 of 4

Jeanette_Fullmer
Community Manager
Community Manager

Hi @CJY, was Joerg Vogel'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