Imagine a fridge and a bunch of random foods. I want to take one food item, automatically put it somewhere in the fridge, and repeat. I can stop at any time.
Basically, the filled fridge should look like it has been gradually stocked over the course of a week or so (as opposed to deliberately organized at once) by a calm human being (as opposed to by someone who's just thrown things into it).
Formally, this procedure has to satisfy the following:
- Similar items should stack or be next to each other given that there is sufficient space (ex. egg cartons cases go in one stack, 2L milk cartons go side by side)
- Other items should not stack until there is no more space left at the bottom
- Placed items should be as upright as possible (ex. plastic-wrapped leftovers shouldn't be sideways), unless limited space requires rotation
- Items should be put somewhere in the center of the fridge when it is relatively empty (instead of being squished to one side)
- The procedure should automatically stop when the fridge no longer has any room left
Ignoring any dividing racks that may be present in the fridge (say it's just one big container), how should this be done? What variables would I need to define with an Item
, and/or what algorithms should I use to determine where to put the next item and how to find out which angle of rotation will give me the fit?