[go: up one dir, main page]

Skip to content

Constraints Basic Interfaces and Classes

Problem to solve

The solution space of a NSP is defined by a set of hard constraints and the quality of solutions is measured according to a set of soft constraints. This package should provide some functionality implementing the existing ISoftConstraint and IHardConstraint interfaces to be able to implement the most common constraint cases without too much effort.

Proposal

Approach

To provide the maximum convenience while providing great flexibility this implementation should rely heavily on the use of interfaces. As shown in the class diagrams below, a user of the package should be able to create it's own kind of constraints, not even matching any of the given type of constraints, but should also be able to create a constraint by just calling its constructor and providing a default constraint type or a lambda specifying the condition.

Type of Constraints

Five types of constraints (each hard and soft) should be considered:

Nurse Relation Constraints

Constraints of this type target the relationship between two nurses, e.g. Nurse A must be scheduled with Nurse B, scheduling Nurse C and Nurse D together leads to chaos therefore they should not be scheduled together, etc.

Nurse Assignment Constraints

Constraints of this type define whether a nurse must / should (not) be assigned to a given shift.

Nurses Constraints

Constraints of this type can be seen as the requirements a nurse poses to the schedule, e.g. the maximum number of shifts or the required number of sparse shifts between shifts.

Shifts Constraints

Constraints of this type can be seen as the requirements a shift poses to the schedule, e.g. the number of nurses required for a specific shift.

Schedule Constraints

These constraints define general criteria / quality features a schedule must / should fufill. This is a really broad field, e.g. nurses must not work in two subsequent shifts, the variance of sparse shifts between shifts should be as small as possible among all nurses, etc.

Relevant code snippets / screenshots

Class Diagram Hard Constraints

Class Diagram Soft Constraints

Edited by Simon Lachnit