question

Vothan Salomão avatar image
0 Likes"
Vothan Salomão asked Logan Gold commented

Issue when using the separator (split) with item.rank

Hello, I’m having an issue with creating a model using a separator (Split). I created this simplified model to demonstrate my problem. When I try to use item.rank to separate the lb_Massa label according to a custom code in the Send to Port.

I’m trying to use the split for a quantity of 3 items, however, it assigns rank 2 more often, then rank 1, and almost never rank 3, and when it does assign rank 3, the model freezes.

What is the assignment criterion for .rank?

Separator Bug.fsm

1725477316005.png


FlexSim 24.2.0
separator.ranksplit mode
1725477316005.png (285.1 KiB)
separator-bug.fsm (28.0 KiB)
· 1
5 |100000

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

Logan Gold avatar image Logan Gold ♦♦ commented ·

Hi @Vothan Salomão, 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 0 ·

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel commented

A send to port is executed on the items rank by state of still kept items in your separator.

Once an item left there are only n-1 items available to evaluate a condition. This is a mismatch many time occurs. First time you evaluate a state you may think it stays static until all items are gone. But this is not true, It is more a dynamic process. To evaluate for a rank three if no more items than two exists won't succeed. Maybe you turn around your logic or you set labels at your items to store there exit ports, when all of them are still present in your separator.

mode_of_splitting_and_involved_rank.fsm

Edit: Attached is a model. I send items by round robin for a separator in split mode on exit and print exiting items rank into the output console. You can always test a behavior of a model function. Commonly objects behaves as meant, but most often not as you assume they should behave. In such circumstances it is a good practice to build a test model to understand what happens. A separator is basically an object to unpack and then optionally to split. This said last kept item is by default a container. All others are a content of the container.


· 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.

Felix Möhlmann avatar image Felix Möhlmann commented ·
The "rank" just denotes the position of the item in the tree. The split functions creates a copy of the original item which will then immediately be released. If there is space in the downstream object (and no transport is used) it will exit the separator before the next copy is created. So all items but the last would have a rank of 2 when the Send to Port code fires.

If the goal is to uniformly distribute the items across the output queues, why don't you just use the "Round Robin" option?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel commented ·
@Vothan Salomão, you can see this also in a different way. Split mode creates for items to be sent an new item until only one item, which is the origin of previous created items, must be called a send to function on. This results in a situation that there only two items simultaneously are present in a separator in split mode. You may assume that on exit that there are three items available. But infact you will see that a separator object does not have any subnodes of available items once processing has finished. At one glimpse before you click into the model tree by a stop on process finish there is a subnode of one item and then after clicking into the tree this subnode is lost.
0 Likes 0 ·