I want to implement multiple layers of grouping and ungrouping of tokens, representing the process of packing and unpacking some boxes. I have multiple sources in the process flow, each of them generating tokens (boxes) with a specific properties and label value.
1. First grouping/labeling:
I want to combine these tokens, group, and label them at each 'x' minutes passing (a time interval), using tokens' creation time. So, tokens that have been generated in the first 'x' minutes of the simulation time, have label 1 and so on.
2. Second grouping/labeling:
I have some number of containers as a resource with the capacity of 'y'. I want to see the tokens that got the same label in step 1 require how many containers. i.e. if they are 15 tokens with label 1 in step 1, they need 'z = ceiling(15/y)' number of containers and will get that value as their label value.
3. After doing some operations on the containers, I want to ungroup them based on the label they got at step 1 and then based on the label they got in step 2.