|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cpsolver.studentsct.constraint.LinkedSections
public class LinkedSections
Linked sections are sections (of different courses) that should be attended by the same students. If there are multiple sections of the same subpart, one or can be chosen randomly. For instance, if section A1 (of a course A) and section B1 (of a course B) are linked, a student requesting both courses must attend A1 if and only if he also attends B1.
Nested Class Summary | |
---|---|
static interface |
LinkedSections.Assignment
Interface to be able to provide a custom assignment to computeConflicts(Enrollment, Assignment, ConflictHandler) |
static interface |
LinkedSections.ConflictHandler
Helper interface to process conflicts in computeConflicts(Enrollment, Assignment, ConflictHandler) |
static class |
LinkedSections.CurrentAssignment
Current assignment -- default for computeConflicts(Enrollment, Assignment, ConflictHandler) |
class |
LinkedSections.LinkedSectionsConstraint
Linked sections constraint -- to be created for each student that requests two or more offerings of this link |
Constructor Summary | |
---|---|
LinkedSections(Collection<Section> sections)
Constructor |
|
LinkedSections(Section... sections)
Constructor |
Method Summary | |
---|---|
void |
computeConflicts(Enrollment enrollment,
LinkedSections.Assignment assignment,
LinkedSections.ConflictHandler conflicts)
Compute conflicting enrollments. |
void |
computeConflicts(Enrollment enrollment,
LinkedSections.ConflictHandler conflicts)
Compute conflicting enrollments. |
void |
createConstraints()
Create linked-section constraints for this link. |
Set<Offering> |
getOfferings()
Return offerings of this link |
Set<Section> |
getSections(Subpart subpart)
Return section (or sections) of a subpart of this link |
Set<Subpart> |
getSubparts(Offering offering)
Return subpart (or subparts) of an offering of this link |
Enrollment |
inConflict(Enrollment enrollment)
Check for conflicts. |
Enrollment |
inConflict(Enrollment enrollment,
LinkedSections.Assignment assignment)
Check for conflicts. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LinkedSections(Section... sections)
sections
- sections that are to be linkedpublic LinkedSections(Collection<Section> sections)
sections
- sections that are to be linkedMethod Detail |
---|
public Set<Offering> getOfferings()
public Set<Subpart> getSubparts(Offering offering)
public Set<Section> getSections(Subpart subpart)
public void createConstraints()
public void computeConflicts(Enrollment enrollment, LinkedSections.ConflictHandler conflicts)
getSubparts(Offering)
), another assignment
of this student is in a conflict, if it does not contain the appropriate sections from
getSubparts(Offering)
and getSections(Subpart)
.
enrollment
- given enrollmentconflicts
- found conflicts are given to this interface, see LinkedSections.ConflictHandler.onConflict(Enrollment)
public void computeConflicts(Enrollment enrollment, LinkedSections.Assignment assignment, LinkedSections.ConflictHandler conflicts)
getSubparts(Offering)
), another assignment
of this student is in a conflict, if it does not contain the appropriate sections from
getSubparts(Offering)
and getSections(Subpart)
.
enrollment
- given enrollmentassignment
- custom assignmentconflicts
- found conflicts are given to this interface, see LinkedSections.ConflictHandler.onConflict(Enrollment)
public Enrollment inConflict(Enrollment enrollment)
getSubparts(Offering)
), another assignment
of this student is in a conflict, if it does not contain the appropriate sections from
getSubparts(Offering)
and getSections(Subpart)
.
enrollment
- given enrollment
public Enrollment inConflict(Enrollment enrollment, LinkedSections.Assignment assignment)
getSubparts(Offering)
), another assignment
of this student is in a conflict, if it does not contain the appropriate sections from
getSubparts(Offering)
and getSections(Subpart)
.
enrollment
- given enrollmentassignment
- custom assignment
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |