JBoss.orgCommunity Documentation

Chapter 2. Use cases and examples

2.1. Introduction
2.2. The n queens example
2.2.1. Screenshot
2.2.2. Problem statement
2.2.3. Solution(s)
2.2.4. Problem size
2.2.5. Domain class diagram
2.3. The ITC 2007 curriculum course example
2.3.1. Problem statement
2.4. The ITC 2007 examination example
2.4.1. Screenshot
2.4.2. Problem statement
2.4.3. Problem size
2.4.4. Domain class diagram
2.5. The INRC 2010 nurse rostering example
2.5.1. Problem statement
2.6. The traveling tournament example
2.6.1. Screenshot
2.6.2. Problem statement
2.6.3. Simple and smart implementation
2.6.4. Problem size
2.7. The Manners 2009 example
2.7.1. Problem statement
2.8. The patient admission scheduling (PAS) example

Drools Planner has several examples. In this manual we explain Drools Planner mainly using the n queens example. So it's advisable to read at least the section about that example. For advanced users, the following examples are recommended: curriculum course, examination and nurse rostering.

You can find the source code of all these examples in the drools source distribution and also in subversion under drools-planner/drools-planner-examples.

In this problem, we have to assign each patient (that will come to the hospital) a bed for each night that the patient will stay in the hospital. 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.

There are a couple of hard constraints:

And of course, there are also some soft constraints:

The problem is defined on this webpage and the test data comes from real world hospitals.