|
||||||||||
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.ifs.model.BinaryConstraint 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 | |
---|---|
boolean |
areStudentConflictsDistance()
|
boolean |
areStudentConflictsDistance(Value value)
|
boolean |
areStudentConflictsHard()
|
void |
assigned(long iteration,
Value value)
Given value is to be assigned to its varable. |
void |
computeConflicts(Value value,
Set 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) |
long |
getJenrl()
Number of joined enrollments (during student final sectioning) |
double |
getJenrlWeight(Student student)
|
int |
getNrStudents()
|
void |
incJenrl(Student student)
Increment the number of joined enrollments (during student final sectioning) |
boolean |
inConflict(Value value)
Returns true if the given assignment is inconsistent with the existing assignments respecting this constraint. |
boolean |
isConsistent(Value value1,
Value 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)
Returns true if the given placements are overlapping or they are back-to-back and too far for students. |
static boolean |
isInConflict(Placement p1,
Placement p2,
boolean useDistances)
|
boolean |
isInConflictPrecise()
True if the given two lectures overlap in time |
boolean |
isOfTheSameProblem()
|
long |
jenrl(Variable variable,
Value value)
Number of joined enrollments if the given value is assigned to the given variable |
String |
toString()
|
void |
unassigned(long iteration,
Value value)
Given value is unassigned from its varable. |
Methods inherited from class net.sf.cpsolver.ifs.model.BinaryConstraint |
---|
addVariable, another, first, isFirst, second |
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
addConstraintListener, assignedVariables, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, getName, 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 computeConflicts(Value value, Set conflicts)
Constraint
computeConflicts
in class Constraint
value
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Value value)
Constraint
MacPropagation
).
inConflict
in class Constraint
public boolean isConsistent(Value value1, Value value2)
Constraint
MacPropagation
).
isConsistent
in class Constraint
public void unassigned(long iteration, Value value)
Constraint
unassigned
in class Constraint
public static boolean isInConflict(Placement p1, Placement p2)
public static boolean isInConflict(Placement p1, Placement p2, boolean useDistances)
public void assigned(long iteration, Value value)
Constraint
assigned
in class Constraint
public long jenrl(Variable variable, Value value)
public boolean isInConflict()
public boolean isInConflictPrecise()
public void incJenrl(Student student)
public double getJenrlWeight(Student student)
public void decJenrl(Student student)
public long getJenrl()
public int getNrStudents()
public boolean isHard()
Constraint
isHard
in class Constraint
public String toString()
toString
in class Object
public boolean areStudentConflictsHard()
public boolean areStudentConflictsDistance()
public boolean areStudentConflictsDistance(Value value)
public boolean isOfTheSameProblem()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |