Search in sources :

Example 96 with Lecture

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

the class FlexibleConstraintCriterion method getValue.

@Override
public double getValue(Assignment<Lecture, Placement> assignment, Collection<Lecture> variables) {
    Set<FlexibleConstraint> flexibleConstraints = new HashSet<FlexibleConstraint>();
    for (Lecture lecture : variables) {
        flexibleConstraints.addAll(lecture.getFlexibleGroupConstraints());
    }
    int ret = 0;
    for (FlexibleConstraint gc : flexibleConstraints) {
        ret += gc.getContext(assignment).getPreference();
    }
    return ret;
}
Also used : FlexibleConstraint(org.cpsolver.coursett.constraint.FlexibleConstraint) Lecture(org.cpsolver.coursett.model.Lecture) FlexibleConstraint(org.cpsolver.coursett.constraint.FlexibleConstraint) HashSet(java.util.HashSet)

Aggregations

Lecture (org.cpsolver.coursett.model.Lecture)96 Placement (org.cpsolver.coursett.model.Placement)55 HashSet (java.util.HashSet)35 TimetableModel (org.cpsolver.coursett.model.TimetableModel)17 WeakeningConstraint (org.cpsolver.ifs.model.WeakeningConstraint)17 HashMap (java.util.HashMap)16 ArrayList (java.util.ArrayList)14 TimeLocation (org.cpsolver.coursett.model.TimeLocation)14 Constraint (org.cpsolver.ifs.model.Constraint)14 InstructorConstraint (org.cpsolver.coursett.constraint.InstructorConstraint)13 Student (org.cpsolver.coursett.model.Student)13 BitSet (java.util.BitSet)11 JenrlConstraint (org.cpsolver.coursett.constraint.JenrlConstraint)10 GlobalConstraint (org.cpsolver.ifs.model.GlobalConstraint)9 RoomLocation (org.cpsolver.coursett.model.RoomLocation)8 Set (java.util.Set)7 TreeSet (java.util.TreeSet)7 GroupConstraint (org.cpsolver.coursett.constraint.GroupConstraint)7 StudentGroup (org.cpsolver.coursett.model.StudentGroup)7 RoomConstraint (org.cpsolver.coursett.constraint.RoomConstraint)6