use of org.cpsolver.studentsct.constraint.StudentConflict in project cpsolver by UniTime.
the class StudentSectioningModel method removeStudent.
/**
* Remove a student from the model
* @param student a student to be removed from the problem
*/
public void removeStudent(Student student) {
iStudents.remove(student);
if (student.isDummy())
iNrDummyStudents--;
StudentConflict conflict = null;
for (Request request : student.getRequests()) {
for (Constraint<Request, Enrollment> c : request.constraints()) {
if (c instanceof StudentConflict) {
conflict = (StudentConflict) c;
break;
}
}
if (conflict != null)
conflict.removeVariable(request);
removeVariable(request);
}
if (conflict != null)
removeConstraint(conflict);
}
Aggregations