public class ExamInstructor extends Constraint<Exam,ExamPlacement>
iAssignedVariables, iConstraintListeners, iId
Constructor and Description |
---|
ExamInstructor(ExamModel model,
long id,
String name) |
Modifier and Type | Method and Description |
---|---|
void |
afterAssigned(long iteration,
ExamPlacement p)
An exam was assigned, update instructor assignment table
|
void |
afterUnassigned(long iteration,
ExamPlacement p)
An exam was unassigned, update instructor assignment table
|
int |
compareTo(ExamInstructor o)
Compare two instructors (by instructor ids)
|
void |
computeConflicts(ExamPlacement p,
Set<ExamPlacement> conflicts)
Compute conflicts between the given assignment of an exam and all the
current assignments (of this instructor).
|
boolean |
equals(Object o)
Compare two instructors for equality
|
Set<Exam> |
getExams(ExamPeriod period)
Exam(s) enrolled by the instructor that are scheduled in the given period
|
Set<Exam> |
getExamsADay(ExamPeriod period)
Exam(s) enrolled by the instructor that are scheduled in the given day
|
Set<Exam> |
getExamsADay(int day)
Exam(s) enrolled by the instructor that are scheduled in the given day
|
String |
getName()
Instructor name
|
List<ExamOwner> |
getOwners()
Courses and/or sections that this instructor is enrolled to
|
int |
hashCode()
Hash code
|
boolean |
hasName()
Instructor name
|
boolean |
inConflict(ExamPlacement p)
Check whether there is a conflict between the given assignment of an exam
and all the current assignments (of this instructor).
|
boolean |
isAllowDirectConflicts()
True when direct instructor conflicts are not allowed.
|
boolean |
isAvailable(ExamPeriod period)
True if the student is available (for examination timetabling) during the
given period
|
boolean |
isConsistent(ExamPlacement p1,
ExamPlacement p2)
True if the given exams can conflict (see
isAllowDirectConflicts() ), or if they are placed
at different periods. |
boolean |
isHard()
Returns true if the constraint is hard.
|
void |
setAllowDirectConflicts(boolean allowDirectConflicts)
Set to true when direct instructor conflicts are not allowed.
|
void |
setAvailable(int period,
boolean available)
Set whether the student is available (for examination timetabling) during
the given period
|
String |
toString()
Instructor name
|
addConstraintListener, addVariable, assigned, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, getDescription, getId, getModel, removeConstraintListener, removeVariable, setModel, unassigned, variables
public ExamInstructor(ExamModel model, long id, String name)
public boolean isAllowDirectConflicts()
public void setAllowDirectConflicts(boolean allowDirectConflicts)
public Set<Exam> getExams(ExamPeriod period)
public Set<Exam> getExamsADay(ExamPeriod period)
public Set<Exam> getExamsADay(int day)
public void computeConflicts(ExamPlacement p, Set<ExamPlacement> conflicts)
isAllowDirectConflicts()
) are considered.computeConflicts
in class Constraint<Exam,ExamPlacement>
p
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(ExamPlacement p)
isAllowDirectConflicts()
) are
considered.inConflict
in class Constraint<Exam,ExamPlacement>
public boolean isConsistent(ExamPlacement p1, ExamPlacement p2)
isAllowDirectConflicts()
), or if they are placed
at different periods.isConsistent
in class Constraint<Exam,ExamPlacement>
public void afterAssigned(long iteration, ExamPlacement p)
public void afterUnassigned(long iteration, ExamPlacement p)
public boolean equals(Object o)
equals
in class Constraint<Exam,ExamPlacement>
public int hashCode()
hashCode
in class Constraint<Exam,ExamPlacement>
public String getName()
getName
in class Constraint<Exam,ExamPlacement>
public boolean hasName()
public int compareTo(ExamInstructor o)
public List<ExamOwner> getOwners()
ExamOwner
public boolean isHard()
Constraint
isHard
in class Constraint<Exam,ExamPlacement>
public boolean isAvailable(ExamPeriod period)
period
- a periodpublic void setAvailable(int period, boolean available)
period
- a periodavailable
- true if a student can attend an exam at the given period,
false if otherwise