use of org.cpsolver.studentsct.constraint.LinkedSections in project cpsolver by UniTime.
the class CourseRequest method getEnrollmentsSkipSameTime.
/**
* Return all possible enrollments, but pick only the first section of
* the sections with the same time (of each subpart, {@link Section}
* comparator is used).
* @param assignment current assignment
* @return computed enrollments
*/
public List<Enrollment> getEnrollmentsSkipSameTime(Assignment<Request, Enrollment> assignment) {
List<Enrollment> ret = new ArrayList<Enrollment>();
int idx = 0;
for (Course course : iCourses) {
for (Config config : course.getOffering().getConfigs()) {
boolean skipSameTime = true;
for (LinkedSections link : getStudent().getLinkedSections()) if (link.getOfferings().contains(course.getOffering())) {
skipSameTime = false;
break;
}
computeEnrollments(assignment, ret, idx, 0, course, config, new HashSet<Section>(), 0, false, skipSameTime, false, false, getMaxDomainSize() <= 0 ? -1 : ret.size() + getMaxDomainSize());
}
idx++;
}
return ret;
}
Aggregations