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;
}
Aggregations