question

Avantasia2012 avatar image
0 Likes"
Avantasia2012 Suspended asked Joerg Vogel edited

pull requirement by rank

lifo.fsmi bult a model, i write some code in the pull requirement of rack outobject:

but i found that the flowitem output sequence is 2,8,25, from small to big, not the 25,8,2,why this happen?would you please help me ?thanks.

FlexSim 7.7.4
pull requirement
lifo.fsm (22.9 KiB)
5 |100000

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

1 Answer

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

The Pull Requirement tests the items in the object in order of entering. If you want to pull an item that got later to the object you mustn’t test in the Pull Requirement items that were earlier in the object.

You can put a print command into the function that prints the rank of the tested item to the output console. You will see that the function will be called several times until the return value becomes true.

You want to pull an item with a high rank, you must be absolutely sure the item is actually in the object. In such a scenario you don’t let the Pull Requirement tests several ranks. You test only one rank! Then you can compare this single rank with the currently tested item rank. If the rank of the tested item and the variable value match, you return a logical true as 1.

You will often find that the comparison statement is directly behind the return command. Because if the comparison doesn’t match the result is 0 or logical false, then the Pull Requirement is called again to test next item with a higher rank.

If the comparison condition gets true, you must erase the value of the rank from the sequence of items to pull. This means you cannot put the comparison directly behind the return command you must use the comparison as a condition in a if-structure to erase first the value of the sequence to test next and then you are allowed to return 1 to get the item pulled.

pull-items-by-rank-v73.fsm


5 |100000

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