Increment and then Decide

Increment and then Decide

mdemalia
Enthusiast Enthusiast
606 Views
5 Replies
Message 1 of 6

Increment and then Decide

mdemalia
Enthusiast
Enthusiast

[ FlexSim 21.2.3 ]

Attached is a simple model. I can use the custom code to increment the token, but it increments them all to the same value. How would I get the source to increment the value. My end goal is to create 4 items and then use the decide to move the first to Queue 2 and then the rest to Queue 3. Any help is appreciated. Increment Item Counter.fsm

0 Likes
Accepted solutions (1)
607 Views
5 Replies
Replies (5)
Message 2 of 6

jose_antonio_mad
Not applicable

Hello @Michael D6 ,

You have different options: create Variables, use a label on an object... or you can simply read object's statistics (see example). Then in the decide you can use the option you need.

I hope I have been helpful.

increment-item-counter_1.fsm

0 Likes
Message 3 of 6

Jeanette_Fullmer
Community Manager
Community Manager
Accepted solution

Hello @Michael D6,

You can assign a label to each created token from the source by creating the label value with
1640189611651.png

0 Likes
Message 4 of 6

mdemalia
Enthusiast
Enthusiast
Hi @Jeanette F thanks for the quick reply. It is not clear to me how I would use that. I tried to add in the value field of the counter label created and it does not increment. Would you be able to provide any additional details on this?
0 Likes
Message 5 of 6

Jeanette_Fullmer
Community Manager
Community Manager
Hello @Michael D6, What I suggested works if the source created all the tokens at once. So if the source created 4 tokens at time 0 and this label was assigned then each token would have an increments value. For instance, the first token would have a 1 and the second token would have a 2.
Message 6 of 6

JordanLJohnson
Autodesk
Autodesk

You can use rowNumber instead of tokenIndex; rowNumber indicates the row of the arrival table that created the token, where tokenIndex is the nth token created on that row.

.


Jordan Johnson
Principal Software Engineer
>