My model currently extracts items from the rack to the sink or places items from the queue into the rack sequentially according to a given array of 0 and 1. Each item is randomly assigned a type (1 or 2), and each time an item is placed into the rack, it is randomly assigned an ID. The Global List named List1 records the status of each slot storing items and the IDs of items in each slot. When executing instruction 0 (extracting items from the rack to the sink), I want to implement two simulations:
1. Prioritize extraction if there are items of type 1 in the rack.
2. Prioritize extraction based on the smaller ID value of items.
How should I modify my code for these two scenarios?
Thanks.