Search in sources :

Example 1 with GroupBasedInitialSectioning

use of org.cpsolver.coursett.sectioning.SctSectioning.GroupBasedInitialSectioning in project cpsolver by UniTime.

the class StudentSwapSectioning method studentsToLectures.

@Override
protected Group[] studentsToLectures(Long offeringId, Collection<Student> students, Collection<Lecture> lectures) {
    if (hasStudentGroups(students)) {
        Set<Lecture> sortedLectures = new TreeSet<Lecture>(new Comparator<Lecture>() {

            @Override
            public int compare(Lecture l1, Lecture l2) {
                return l1.getClassId().compareTo(l2.getClassId());
            }
        });
        sortedLectures.addAll(lectures);
        GroupBasedInitialSectioning sect = new GroupBasedInitialSectioning(getProgress(), offeringId, sortedLectures, students);
        return sect.getGroups();
    } else {
        return super.studentsToLectures(offeringId, students, lectures);
    }
}
Also used : GroupBasedInitialSectioning(org.cpsolver.coursett.sectioning.SctSectioning.GroupBasedInitialSectioning) Lecture(org.cpsolver.coursett.model.Lecture) TreeSet(java.util.TreeSet)

Aggregations

TreeSet (java.util.TreeSet)1 Lecture (org.cpsolver.coursett.model.Lecture)1 GroupBasedInitialSectioning (org.cpsolver.coursett.sectioning.SctSectioning.GroupBasedInitialSectioning)1