public class RequiredReservation extends GlobalConstraint<Request,Enrollment>
Reservation.mustBeUsed()
flags are used. That is, an enrollment
is conflicting when there is a reservation for the student that must be used,
but the given enrollment does not use it.iAssignedVariables, iConstraintListeners, iId
Constructor and Description |
---|
RequiredReservation() |
Modifier and Type | Method and Description |
---|---|
void |
computeConflicts(Enrollment enrollment,
Set<Enrollment> conflicts)
A given enrollment is conflicting, if there is a reservation that
the student must use, but the given enrollment does not use it.
|
boolean |
inConflict(Enrollment enrollment)
A given enrollment is conflicting, if there is a reservation that
the student must use, but the given enrollment does not use it.
|
String |
toString() |
addVariable, assigned, assignedVariables, removeVariable, unassigned, variables
addConstraintListener, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, getName, hashCode, isConsistent, isHard, removeConstraintListener, setModel
public RequiredReservation()
public void computeConflicts(Enrollment enrollment, Set<Enrollment> conflicts)
computeConflicts
in class Constraint<Request,Enrollment>
enrollment
- Enrollment
that is being consideredconflicts
- all computed conflicting requests are added into this setpublic boolean inConflict(Enrollment enrollment)
inConflict
in class Constraint<Request,Enrollment>
enrollment
- Enrollment
that is being considered