|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.ifs.model.Constraint net.sf.cpsolver.exam.model.ExamStudent
public class ExamStudent
A student.
Field Summary |
---|
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
iAssignedVariables, iConstraintListeners, iId |
Constructor Summary | |
---|---|
ExamStudent(ExamModel model,
long id)
Constructor |
Method Summary | |
---|---|
void |
afterAssigned(long iteration,
Value value)
An exam was assigned, update student assignment table |
void |
afterUnassigned(long iteration,
Value value)
An exam was unassigned, update student assignment table |
boolean |
canConflict(Exam ex1,
Exam ex2)
True if the given two exams can have a direct student conflict with this student, i.e., they can be placed at the same period. |
int |
compareTo(Object o)
Compare two students (by student ids) |
void |
computeConflicts(Value value,
Set conflicts)
Compute conflicts between the given assignment of an exam and all the current assignments (of this student). |
boolean |
equals(Object o)
Compare two student for equality |
Set |
getExams(ExamPeriod period)
Exam(s) enrolled by the student that are scheduled in the given period |
Set |
getExamsADay(ExamPeriod period)
Exam(s) enrolled by the student that are scheduled in the given day |
Set |
getExamsADay(int day)
Exam(s) enrolled by the student that are scheduled in the given day |
Vector |
getOwners()
Courses and/or sections that this student is enrolled to |
int |
hashCode()
Hash code |
boolean |
inConflict(Value value)
Check whether there is a conflict between the given assignment of an exam and all the current assignments (of this student). |
boolean |
isAllowDirectConflicts()
True if direct student conflicts are allowed for this student |
boolean |
isAvailable(ExamPeriod period)
True if the student is available (for examination timetabling) during the given period |
boolean |
isConsistent(Value value1,
Value value2)
True if the given exams can conflict (see canConflict(Exam, Exam) ),
or if they are placed at different periods. |
boolean |
isHard()
Constraint is hard if isAllowDirectConflicts() is false. |
void |
setAllowDirectConflicts(boolean allowDirectConflicts)
Set whether direct student conflicts are allowed for this student |
void |
setAvailable(int period,
boolean available)
Set whether the student is available (for examination timetabling) during the given period |
String |
toString()
Student unique id |
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
addConstraintListener, addVariable, assigned, assignedVariables, constraintListeners, countAssignedVariables, countVariables, getDescription, getId, getModel, getName, removeConstraintListener, removeVariable, setModel, unassigned, variables |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExamStudent(ExamModel model, long id)
model
- examination timetabling modelid
- student unique idMethod Detail |
---|
public boolean isAllowDirectConflicts()
public void setAllowDirectConflicts(boolean allowDirectConflicts)
public boolean canConflict(Exam ex1, Exam ex2)
ex1
- an examex2
- an exam
isAllowDirectConflicts()
and Exam.isAllowDirectConflicts()
for
both examspublic Set getExams(ExamPeriod period)
public Set getExamsADay(ExamPeriod period)
public Set getExamsADay(int day)
public void computeConflicts(Value value, Set conflicts)
canConflict(Exam, Exam)
are considered.
computeConflicts
in class Constraint
value
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Value value)
canConflict(Exam, Exam)
are considered.
inConflict
in class Constraint
public boolean isConsistent(Value value1, Value value2)
canConflict(Exam, Exam)
),
or if they are placed at different periods.
isConsistent
in class Constraint
public void afterAssigned(long iteration, Value value)
public void afterUnassigned(long iteration, Value value)
public boolean equals(Object o)
equals
in class Constraint
public int hashCode()
hashCode
in class Constraint
public String toString()
toString
in class Object
public int compareTo(Object o)
compareTo
in interface Comparable
public boolean isHard()
isAllowDirectConflicts()
is false.
isHard
in class Constraint
public Vector getOwners()
ExamOwner
public boolean isAvailable(ExamPeriod period)
period
- a period
public void setAvailable(int period, boolean available)
period
- a periodavailable
- true if a student can attend an exam at the given period, false if otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |