|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cpsolver.ifs.model.Constraint<V,T>
net.sf.cpsolver.ifs.model.BinaryConstraint<Lecture,Placement>
net.sf.cpsolver.coursett.constraint.JenrlConstraint
public class JenrlConstraint
Join student enrollment constraint.
This constraint is placed between all pairs of classes where there is at
least one student attending both classes. It represents a number of student
conflicts (number of joined enrollments), if the given two classes overlap in
time.
Also, it dynamically maintains the counter of all student conflicts. It is a
soft constraint.
Field Summary |
---|
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
iAssignedVariables, iConstraintListeners, iId |
Constructor Summary | |
---|---|
JenrlConstraint()
Constructor |
Method Summary | |
---|---|
void |
addVariable(Lecture variable)
Add a variable to this constraint |
boolean |
areStudentConflictsCommitted()
|
boolean |
areStudentConflictsDistance()
|
boolean |
areStudentConflictsDistance(Placement value)
|
boolean |
areStudentConflictsHard()
|
void |
assigned(long iteration,
Placement value)
Given value is to be assigned to its varable. |
void |
computeConflicts(Placement value,
Set<Placement> conflicts)
The only method which has to be implemented by any constraint. |
void |
decJenrl(Student student)
Decrement the number of joined enrollments (during student final sectioning) |
Set<Student> |
getInstructors()
|
long |
getJenrl()
Number of joined enrollments (during student final sectioning) |
double |
getJenrlWeight(Student student)
|
String |
getName()
Constraint's name -- for printing purposes |
int |
getNrInstructors()
|
int |
getNrStudents()
|
Set<Student> |
getStudents()
|
void |
incJenrl(Student student)
Increment the number of joined enrollments (during student final sectioning) |
boolean |
inConflict(Placement value)
Returns true if the given assignment is inconsistent with the existing assignments respecting this constraint. |
boolean |
isConsistent(Placement value1,
Placement value2)
Returns true if the given assignments are consistent respecting this constraint. |
boolean |
isHard()
Returns true if the constraint is hard. |
boolean |
isInConflict()
True if the given two lectures overlap in time |
static boolean |
isInConflict(Placement p1,
Placement p2,
DistanceMetric m)
Returns true if the given placements are overlapping or they are back-to-back and too far for students. |
boolean |
isOfTheSameProblem()
|
boolean |
isOverLimit()
|
boolean |
isToBeIgnored()
Returns true if there is IgnoreStudentConflictsConstraint between the two lectures. |
double |
jenrl()
|
long |
jenrl(Lecture variable,
Placement value)
Number of joined enrollments if the given value is assigned to the given variable |
double |
priority()
|
String |
toString()
|
void |
unassigned(long iteration,
Placement value)
Given value is unassigned from its variable. |
void |
weaken()
Weaken the constraint. |
void |
weaken(Placement value)
Weaken the constraint enough so that it can assign the given value. |
Methods inherited from class net.sf.cpsolver.ifs.model.BinaryConstraint |
---|
another, first, isFirst, second |
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
addConstraintListener, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, removeConstraintListener, removeVariable, setModel, variables |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JenrlConstraint()
Method Detail |
---|
public void addVariable(Lecture variable)
Constraint
addVariable
in class BinaryConstraint<Lecture,Placement>
public void computeConflicts(Placement value, Set<Placement> conflicts)
Constraint
computeConflicts
in class Constraint<Lecture,Placement>
value
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Placement value)
Constraint
MacPropagation
).
inConflict
in class Constraint<Lecture,Placement>
public boolean isConsistent(Placement value1, Placement value2)
Constraint
MacPropagation
).
isConsistent
in class Constraint<Lecture,Placement>
public void unassigned(long iteration, Placement value)
Constraint
unassigned
in class Constraint<Lecture,Placement>
public static boolean isInConflict(Placement p1, Placement p2, DistanceMetric m)
public void assigned(long iteration, Placement value)
Constraint
assigned
in class Constraint<Lecture,Placement>
public long jenrl(Lecture variable, Placement value)
public boolean isInConflict()
public void incJenrl(Student student)
public double getJenrlWeight(Student student)
public void decJenrl(Student student)
public long getJenrl()
public double jenrl()
public double priority()
public int getNrStudents()
public Set<Student> getStudents()
public int getNrInstructors()
public Set<Student> getInstructors()
public boolean isHard()
Constraint
isHard
in class Constraint<Lecture,Placement>
public boolean isOverLimit()
public String getName()
Constraint
getName
in class Constraint<Lecture,Placement>
public String toString()
toString
in class Object
public boolean areStudentConflictsHard()
public boolean areStudentConflictsDistance()
public boolean areStudentConflictsCommitted()
public boolean areStudentConflictsDistance(Placement value)
public boolean isOfTheSameProblem()
public void weaken()
WeakeningConstraint
weaken
in interface WeakeningConstraint<Lecture,Placement>
public void weaken(Placement value)
WeakeningConstraint
weaken
in interface WeakeningConstraint<Lecture,Placement>
public boolean isToBeIgnored()
IgnoreStudentConflictsConstraint
between the two lectures.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |