Search in sources :

Example 6 with Configuration

use of org.cpsolver.coursett.model.Configuration in project cpsolver by UniTime.

the class SctStudent method computeEnrollments.

/**
 * Compute all possible enrollments
 */
private void computeEnrollments() {
    iEnrollments = new ArrayList<SctEnrollment>();
    if (isInstructing()) {
        double conflictWeight = 0.0;
        for (Lecture lecture : getInstructingLectures()) {
            for (Lecture other : getStudent().getLectures()) if (!getModel().getOfferingId().equals(other.getConfiguration().getOfferingId()))
                conflictWeight += getJenrConflictWeight(lecture, other);
        }
        iEnrollments.add(new SctEnrollment(0, this, getInstructingLectures(), conflictWeight));
        return;
    }
    for (Configuration configuration : getModel().getConfigurations()) {
        Map<Long, Set<Lecture>> subparts = getModel().getSubparts(configuration);
        List<Long> subpartIds = getSubpartIds(configuration);
        computeEnrollments(configuration, subparts, subpartIds, new HashSet<Lecture>(), 0.0);
    }
    Collections.sort(iEnrollments);
}
Also used : Lecture(org.cpsolver.coursett.model.Lecture) Set(java.util.Set) HashSet(java.util.HashSet) Configuration(org.cpsolver.coursett.model.Configuration)

Aggregations

Configuration (org.cpsolver.coursett.model.Configuration)6 Lecture (org.cpsolver.coursett.model.Lecture)6 HashSet (java.util.HashSet)4 Set (java.util.Set)3 Student (org.cpsolver.coursett.model.Student)3 ArrayList (java.util.ArrayList)2 BitSet (java.util.BitSet)2 HashMap (java.util.HashMap)2 List (java.util.List)2 Map (java.util.Map)2 ClassLimitConstraint (org.cpsolver.coursett.constraint.ClassLimitConstraint)2 DiscouragedRoomConstraint (org.cpsolver.coursett.constraint.DiscouragedRoomConstraint)2 GroupConstraint (org.cpsolver.coursett.constraint.GroupConstraint)2 IgnoreStudentConflictsConstraint (org.cpsolver.coursett.constraint.IgnoreStudentConflictsConstraint)2 InstructorConstraint (org.cpsolver.coursett.constraint.InstructorConstraint)2 JenrlConstraint (org.cpsolver.coursett.constraint.JenrlConstraint)2 MinimizeNumberOfUsedGroupsOfTime (org.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime)2 MinimizeNumberOfUsedRoomsConstraint (org.cpsolver.coursett.constraint.MinimizeNumberOfUsedRoomsConstraint)2 RoomConstraint (org.cpsolver.coursett.constraint.RoomConstraint)2 SoftInstructorConstraint (org.cpsolver.coursett.constraint.SoftInstructorConstraint)2