Luu Khanh Minh Posted November 15, 2018 Share Posted November 15, 2018 In my model, there is a combiner that generates a batch of 30 entities. After the combiner, I want to assign exactly 30% of the bach population (i.e: 9 members in a 30-member batch) to state "A" and the remaining 70% of the batch population (i.e: 21 members in a 30-member batch) to state "B". May I have some suggestions as to how to do so? Note that the number of members in a batch is varying for different batches Thank you! Link to comment Share on other sites More sharing options...
gocken Posted November 17, 2018 Share Posted November 17, 2018 you can use a search step in an appropriate process (you can create a new process or use an add-on process where needed). In the search step you should search the queustate of modelentity.batchmember. Here you can set a match condition if required. If you do not want to set a match condition the search step will search the first 9 entities in the batch (I assume that the batch quantity is 30. If it is a different value Math.Ceiling(Combiner.BatchQuantity*0.3) expression will be evaluated and will be round up the next integer. (You can use math.floor function as well.) Then in the assign step set the required statevariable of modelentity to the new value. 1 Link to comment Share on other sites More sharing options...
Luu Khanh Minh Posted November 19, 2018 Author Share Posted November 19, 2018 Thank you gocken. You suggestion we very helpful! Link to comment Share on other sites More sharing options...
Luu Khanh Minh Posted November 26, 2018 Author Share Posted November 26, 2018 Hello I would like to revive this thread. So In my model, there is a combiner that generates a batch by batching 1 parent entity and 29 member entities together. After the combiner, I want to assign exactly 30% of 30 entities(i.e: both the parent and the member entities) to state "A" and the remaining 70% of the 30 entities to state "B". May I have some suggestions as to how to do so? Thank you! Link to comment Share on other sites More sharing options...
gocken Posted November 26, 2018 Share Posted November 26, 2018 If I were you I made these assignments before sending modelentities to combiner object. Then combine them all... Sometimes "think different" works for simulation Link to comment Share on other sites More sharing options...
Recommended Posts