Each bed belongs to a room and each room belongs to a department. The arrival and departure dates of the patients is fixed: only a bed needs to be assigned for each night.
- 2 patients shouldn't be assigned to the same bed in the same night (not even if they are married :).
- A room can have a gender limitation: only females, only males, the same gender in the same night or no gender limitation at all.
- A departement can have a minimum or maximum age.
- A patient can require a room with specific equipment(s).
- A patient can prefer a maximum room size, for example if he/she want a single room.
- A patient is best assigned to a department that specializes in his/her problem.
- A patient is best assigned to a room that specializes in his/her problem.
- A patient can prefer a room with specific equipment(s).
Drools-solver solves this planning problem. Here's a screenshot of a result: