An interface marking an assignment context. The idea is that each
class that needs to keep some assignment dependent data will implements
HasAssignmentContext
interface and the data will be wrapped by this class.
The
HasAssignmentContext
will only contain a reference to this
assignment context, created by calling
Model.createReference(HasAssignmentContext)
during its initialization. The assignment context can be than accessed by calling
Assignment.getAssignmentContext(AssignmentContextReference)
.
These assignment contexts are being held in memory by a class implementing the
AssignmentContextHolder
interface. For constraints, criteria, extensions, and
neighborhood selections an existing class implementing the context can be used, see
ConstraintWithContext
,
AbstractCriterion
,
ExtensionWithContext
,
and
NeighbourSelectionWithContext
respectively.
For instance, when implementing
ConstraintWithContext
, only the method
HasAssignmentContext.createAssignmentContext(Assignment)
needs to be implemented and the
assignment context can be accessed within the constraint using the method
ConstraintWithContext.getContext(Assignment)
.