public class InstructorConstraint extends Constraint<Lecture,Placement>
DistanceMetric.getInstructorNoPreferenceLimit()
.. no preference
DistanceMetric.getInstructorNoPreferenceLimit()
and below
DistanceMetric.getInstructorDiscouragedLimit()
.. constraint is
discouraged (soft, preference = 1)
DistanceMetric.getInstructorDiscouragedLimit()
and below
DistanceMetric.getInstructorProhibitedLimit()
.. constraint is
strongly discouraged (soft, preference = 2)
DistanceMetric.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).Modifier and Type | Field and Description |
---|---|
int |
iPreference |
protected List<Placement>[] |
iResource
table iResource[slot] = lecture using this resource placed in the given
time slot (null if empty)
|
iAssignedVariables, iConstraintListeners, iId
Constructor and Description |
---|
InstructorConstraint(Long id,
String puid,
String name,
boolean ignDist)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
assigned(long iteration,
Placement placement)
Given value is to be assigned to its varable.
|
void |
computeConflicts(Placement placement,
Set<Placement> conflicts)
The only method which has to be implemented by any constraint.
|
int |
countPreference() |
int |
countUselessSlots()
Number of useless slots for this resource
|
List<Placement>[] |
getAvailableArray()
Deprecated.
|
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) |
List<Placement> |
getPlacements(int slot,
BitSet weekCode) |
List<Placement> |
getPlacements(int slot,
Placement placement) |
int |
getPreference()
Overall back-to-back preference of this instructor
|
int |
getPreference(Placement value)
Back-to-back preference of the given placement
|
int |
getPreferenceCombination(Placement value) |
String |
getPuid() |
List<Placement> |
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() |
List<Placement> |
getUnavailabilities() |
int |
getWorstPreference()
Worst back-to-back preference of this instructor
|
boolean |
inConflict(Placement placement)
Returns true if the given assignment is inconsistent with the existing
assignments respecting this constraint.
|
boolean |
isAvailable(Lecture lecture,
Placement placement) |
boolean |
isAvailable(Lecture lecture,
TimeLocation time) |
boolean |
isConsistent(Placement p1,
Placement p2)
Returns true if the given assignments are consistent respecting this
constraint.
|
boolean |
isIgnoreDistances() |
protected void |
printUsage(StringBuffer sb)
Resource usage usage
|
void |
setIgnoreDistances(boolean ignDist) |
void |
setNotAvailable(Placement placement) |
void |
setType(Long type) |
String |
toString() |
void |
unassigned(long iteration,
Placement placement)
Given value is unassigned from its variable.
|
addConstraintListener, addVariable, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variables
public int iPreference
public InstructorConstraint(Long id, String puid, String name, boolean ignDist)
id
- instructor idname
- instructor namepublic List<Placement> getPlacements(int slot, Placement placement)
public List<Placement> getPlacements(int slot, BitSet weekCode)
public Placement getPlacement(int slot, int day)
public void setNotAvailable(Placement placement)
public boolean isAvailable(Lecture lecture, TimeLocation time)
public boolean isAvailable(Lecture lecture, Placement placement)
public List<Placement> getUnavailabilities()
@Deprecated public List<Placement>[] getAvailableArray()
public int getDistancePreference(Placement p1, Placement p2)
public Long getResourceId()
public String getName()
getName
in class Constraint<Lecture,Placement>
public void computeConflicts(Placement placement, Set<Placement> conflicts)
Constraint
computeConflicts
in class Constraint<Lecture,Placement>
placement
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Placement placement)
Constraint
MacPropagation
).inConflict
in class Constraint<Lecture,Placement>
public boolean isConsistent(Placement p1, Placement p2)
Constraint
MacPropagation
).isConsistent
in class Constraint<Lecture,Placement>
public void assigned(long iteration, Placement placement)
Constraint
assigned
in class Constraint<Lecture,Placement>
public void unassigned(long iteration, Placement placement)
Constraint
unassigned
in class Constraint<Lecture,Placement>
public List<Placement> getResource(int slot)
public Placement[] getResourceOfWeek(int startDay)
public int countUselessSlots()
protected void printUsage(StringBuffer sb)
public int getPreference(Placement value)
public int getPreferenceCombination(Placement value)
public int getPreference()
public int countPreference()
public int getWorstPreference()
public boolean isIgnoreDistances()
public void setIgnoreDistances(boolean ignDist)