If you are an official user of V2019, you can directly contact our agent in China : CSN. Our company will provide professional and quick technical support. Technical Q&A mailbox: [email protected] you.
It is a fine model. The batch activity must alternately batch 3 and then 2 items, as you described above. The difference is only one. You get a constant number stream of {0,1,0,1,0,1,..} by modulus division of 2 for an increasing number stream of one {0,1,2,3,4,5,6,..}. This number stream can you get from any statistical Input or Output of an activity like the batching activity. Because the stream must be increasing by 1, you must choose here the output value of the batching activity. Unfortunately the output value of the first releasing token is 0, you have to add 1 to this value to get a return value of 1.
statistical output stream is 0,1,2,3,4,5,..
//(statistical output value +1) modulus division by 2, then enhanced by 2 (getstat(activity, "Output", STAT_CURRENT, current)+1)%2+2
statement stream results in 3,2,3,2,3,..
Now your array of items contains 3 or 2 item references. You can't use a static sequence to combine the 2nd and 3rd item into the 1st item anymore.
I have added in my model the later variant to move items and use therein the first variant to change the location for the combined items. Because I need a reference from the end of the array to move into the first item, I choose this element by the pop() method and assign it to a label at the token in the sub flow.
Later in the sub flow I use the rank of this item to set different locations by a decision structure.
I have added another items array as a label to the batched token, because I didn't know if you need your array called items later in your logic again. The method pop() eliminates the returned element of the array. The original data isn't kept.
How do you alternate 3, 3, and 4. changing the position of each item.
A larger sequence needs an indirect approach over an array. The sequence of batch sizes is stored in an array, maybe in a global variable [3,3,4]. You get the value of a current batchsize through a modulus operation. The result will be 0,1,2,0,1,2,0,1,2,.. This isn't suited for the indexes of an array which starts with 1. You add simply 1 to the modulus result.
getstat(activity, "Output", STAT_CURRENT, current)%3+1
Then the batchsize is:
yourGlobVar[getstat(activity, "Output", STAT_CURRENT, current)%3+1]
stacking3-3-4.fsmHow to change the position of items.Thank you.
Hello @xiang, you get probably a faster answer if you ask your request in a new question. In my opinion your request has nothing to do with an alternating sequence of item grabbing. It is more likely a question of setting locations or stacking. Many thanks for considering my comment. Regards Jörg.
13 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved