|
||||||||||
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.coursett.constraint.InstructorConstraint
public class InstructorConstraint
Instructor constraint.
Classes with this instructor can not overlap in time. Also, for back-to-back classes,
there is the following reasoning:
TimetableModel.getInstructorNoPreferenceLimit()
.. no preference
TimetableModel.getInstructorNoPreferenceLimit()
and below TimetableModel.getInstructorDiscouragedLimit()
.. constraint is discouraged (soft, preference = 1)
TimetableModel.getInstructorDiscouragedLimit()
and below TimetableModel.getInstructorProhibitedLimit()
.. constraint is strongly discouraged (soft, preference = 2)
TimetableModel.getInstructorProhibitedLimit()
.. constraint is prohibited (hard)
isIgnoreDistances()
is set to true, the constraint never prohibits two back-to-back classes (but it still tries to minimize the above back-to-back preferences).
Field Summary | |
---|---|
int |
iPreference
|
protected Vector[] |
iResource
table iResource[slot] = lecture using this resource placed in the given time slot (null if empty) |
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
iAssignedVariables, iConstraintListeners, iId |
Constructor Summary | |
---|---|
InstructorConstraint(Long id,
String puid,
String name,
boolean ignDist)
Constructor |
Method Summary | |
---|---|
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. |
int |
countPreference()
|
int |
countUselessSlots()
Number of useless slots for this resource |
Vector[] |
getAvailableArray()
|
int |
getDistancePreference(Placement p1,
Placement p2)
Back-to-back preference of two placements (3 means prohibited) |
String |
getName()
Resource name |
Placement |
getPlacement(int slot,
int day)
|
Vector |
getPlacements(int slot,
BitSet weekCode)
|
Vector |
getPlacements(int slot,
Placement placement)
|
int |
getPreference()
Overall back-to-back preference of this instructor |
int |
getPreference(Value value)
Back-to-back preference of the given placement |
int |
getPreferenceCombination(Value value)
|
String |
getPuid()
|
Vector |
getResource(int slot)
Lookup table getResource()[slot] -> lecture using this resource placed in the given time slot (null if empty) |
Long |
getResourceId()
Resource id |
Placement[] |
getResourceOfWeek(int startDay)
|
Long |
getType()
|
int |
getWorstPreference()
Worst back-to-back preference of this instructor |
boolean |
inConflict(Value value)
Returns true if the given assignment is inconsistent with the existing assignments respecting this constraint. |
boolean |
isAvailable(int slot)
|
boolean |
isAvailable(Lecture lecture,
Placement placement)
|
boolean |
isAvailable(Lecture lecture,
TimeLocation time)
|
boolean |
isConsistent(Value value1,
Value value2)
Returns true if the given assignments are consistent respecting this constraint. |
boolean |
isIgnoreDistances()
|
protected void |
printUsage(StringBuffer sb)
Resource usage usage |
void |
setNotAvailable(Placement placement)
|
void |
setType(Long type)
|
String |
toString()
|
void |
unassigned(long iteration,
Value value)
Given value is unassigned from its varable. |
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
addConstraintListener, addVariable, assignedVariables, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variables |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public int iPreference
protected Vector[] iResource
Constructor Detail |
---|
public InstructorConstraint(Long id, String puid, String name, boolean ignDist)
id
- instructor idname
- instructor nameMethod Detail |
---|
public Vector getPlacements(int slot, Placement placement)
public Vector getPlacements(int slot, BitSet weekCode)
public Placement getPlacement(int slot, int day)
public void setNotAvailable(Placement placement)
public boolean isAvailable(int slot)
public boolean isAvailable(Lecture lecture, TimeLocation time)
public boolean isAvailable(Lecture lecture, Placement placement)
public Vector[] getAvailableArray()
public int getDistancePreference(Placement p1, Placement p2)
public Long getResourceId()
public String getName()
getName
in class Constraint
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 assigned(long iteration, Value value)
Constraint
assigned
in class Constraint
public void unassigned(long iteration, Value value)
Constraint
unassigned
in class Constraint
public Vector getResource(int slot)
public Placement[] getResourceOfWeek(int startDay)
public int countUselessSlots()
protected void printUsage(StringBuffer sb)
public String toString()
toString
in class Object
public int getPreference(Value value)
public int getPreferenceCombination(Value value)
public int getPreference()
public int countPreference()
public int getWorstPreference()
public String getPuid()
public boolean isIgnoreDistances()
public Long getType()
public void setType(Long type)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |