public class SoftInstructorConstraint extends InstructorConstraint
Modifier and Type | Class and Description |
---|---|
class |
SoftInstructorConstraint.SoftInstructorConstraintContext |
InstructorConstraint.InstructorConstraintContext
iConstraintListeners, iId
sMaxSize
Constructor and Description |
---|
SoftInstructorConstraint(Long id,
String puid,
String name,
boolean ignDist) |
Modifier and Type | Method and Description |
---|---|
void |
computeConflicts(Assignment<Lecture,Placement> assignment,
Placement placement,
Set<Placement> conflicts)
The only method which has to be implemented by any constraint.
|
InstructorConstraint.InstructorConstraintContext |
createAssignmentContext(Assignment<Lecture,Placement> assignment)
Create a new assignment context for the given assignment.
|
int |
getConflicts(Assignment<Lecture,Placement> assignment) |
int |
getConflicts(Assignment<Lecture,Placement> assignment,
Placement placement) |
int |
getWorstConflicts() |
boolean |
inConflict(Assignment<Lecture,Placement> assignment,
Placement placement)
Returns true if the given assignment is inconsistent with the existing
assignments respecting this constraint.
|
boolean |
isConsistent(Placement p1,
Placement p2)
Returns true if the given assignments are consistent respecting this
constraint.
|
boolean |
isHard()
Returns true if the constraint is hard.
|
getAvailableArray, getDistanceMetric, getDistancePreference, getName, getPreference, getPreference, getPreferenceCombination, getPuid, getResourceId, getType, getUnavailabilities, getWorstPreference, isAvailable, isAvailable, isIgnoreDistances, setIgnoreDistances, setNotAvailable, setType, toString
assigned, getAssignmentContextReference, getContext, getContext, setAssignmentContextReference, setModel, unassigned
addConstraintListener, addVariable, assignedVariables, compareTo, computeConflictsNoForwardCheck, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, removeConstraintListener, removeVariable, variables
public SoftInstructorConstraint(Long id, String puid, String name, boolean ignDist)
public void computeConflicts(Assignment<Lecture,Placement> assignment, Placement placement, Set<Placement> conflicts)
Constraint
computeConflicts
in class InstructorConstraint
assignment
- current assignmentplacement
- value to be assigned to its variableconflicts
- resultant set of conflicting valuespublic boolean inConflict(Assignment<Lecture,Placement> assignment, Placement placement)
Constraint
MacPropagation
).inConflict
in class InstructorConstraint
assignment
- current assignmentplacement
- given valuepublic boolean isConsistent(Placement p1, Placement p2)
Constraint
MacPropagation
).isConsistent
in class InstructorConstraint
p1
- a valuep2
- a valuepublic boolean isHard()
Constraint
isHard
in class Constraint<Lecture,Placement>
public InstructorConstraint.InstructorConstraintContext createAssignmentContext(Assignment<Lecture,Placement> assignment)
HasAssignmentContext
createAssignmentContext
in interface HasAssignmentContext<Lecture,Placement,InstructorConstraint.InstructorConstraintContext>
createAssignmentContext
in class InstructorConstraint
assignment
- an assignment for which there needs to be an assignment contextpublic int getConflicts(Assignment<Lecture,Placement> assignment)
public int getConflicts(Assignment<Lecture,Placement> assignment, Placement placement)
public int getWorstConflicts()