public class StudentConflict extends Constraint<Request,Enrollment>
iConstraintListeners, iId
Constructor and Description |
---|
StudentConflict(Student student)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static boolean |
canAssign(Assignment<Request,Enrollment> assignment,
Enrollment enrollment,
Set<Enrollment> conflicts)
True if the given enrollment can be assigned to the student.
|
void |
computeConflicts(Assignment<Request,Enrollment> assignment,
Enrollment enrollment,
Set<Enrollment> conflicts)
A given enrollment is conflicting when the student is enrolled into
another course / free time request that has an assignment that is
overlapping with one or more assignments of the given section.
|
boolean |
inConflict(Assignment<Request,Enrollment> assignment,
Enrollment enrollment)
A given enrollment is conflicting when the student is enrolled into
another course / free time request that has an assignment that is
overlapping with one or more assignments of the given section.
|
boolean |
isConsistent(Enrollment e1,
Enrollment e2)
Two enrollments are consistent if they are not overlapping in time
|
String |
toString() |
addConstraintListener, addVariable, assigned, assignedVariables, compareTo, computeConflictsNoForwardCheck, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, getName, hashCode, isHard, removeConstraintListener, removeVariable, setModel, unassigned, variables
public StudentConflict(Student student)
student
- student for which the constraint is createdpublic static boolean canAssign(Assignment<Request,Enrollment> assignment, Enrollment enrollment, Set<Enrollment> conflicts)
assignment
- current assignmentenrollment
- given enrollmentpublic void computeConflicts(Assignment<Request,Enrollment> assignment, Enrollment enrollment, Set<Enrollment> conflicts)
Enrollment.isOverlapping(Enrollment)
for more details. All such
overlapping enrollments are added into the provided set of conflicts.computeConflicts
in class Constraint<Request,Enrollment>
enrollment
- Enrollment
that is being consideredconflicts
- resultant list of conflicting enrollmentsassignment
- current assignmentpublic boolean isConsistent(Enrollment e1, Enrollment e2)
isConsistent
in class Constraint<Request,Enrollment>
e1
- a valuee2
- a valuepublic boolean inConflict(Assignment<Request,Enrollment> assignment, Enrollment enrollment)
Enrollment.isOverlapping(Enrollment)
for more details.inConflict
in class Constraint<Request,Enrollment>
enrollment
- Enrollment
that is being consideredassignment
- current assignment