public class MaxBreaksFlexibleConstraint extends FlexibleConstraint implements WeakeningConstraint<Lecture,Placement>
FlexibleConstraint.Block, FlexibleConstraint.FlexibleConstraintType, FlexibleConstraint.PlacementTimeComparator
iConstraintType, iReference, iWeeks
iAssignedVariables, iConstraintListeners, iId
Constructor and Description |
---|
MaxBreaksFlexibleConstraint(Long id,
String owner,
String preference,
String reference) |
Modifier and Type | Method and Description |
---|---|
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.
|
List<FlexibleConstraint.Block> |
getBlocks(int dayCode,
Set<Placement> conflicts,
Placement value,
HashMap<Lecture,Placement> assignments,
BitSet week) |
double |
getNrViolations(Set<Placement> conflicts,
HashMap<Lecture,Placement> assignments) |
void |
weaken()
Weaken the constraint.
|
void |
weaken(Placement value)
Weaken the constraint enough so that it can assign the given
value.
|
getCurrentPreference, getName, getOwner, getPrologPreference, getReference, getRelevantPlacements, getType, getWeeks, isConsistent, isHard, mergeToBlocks, toString, unassigned
addConstraintListener, addVariable, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, inConflict, removeConstraintListener, removeVariable, setModel, variables
public MaxBreaksFlexibleConstraint(Long id, String owner, String preference, String reference)
public List<FlexibleConstraint.Block> getBlocks(int dayCode, Set<Placement> conflicts, Placement value, HashMap<Lecture,Placement> assignments, BitSet week)
public double getNrViolations(Set<Placement> conflicts, HashMap<Lecture,Placement> assignments)
getNrViolations
in class FlexibleConstraint
conflicts
- conflicting placements to be unassignedassignments
- assigned placementspublic void computeConflicts(Placement value, Set<Placement> conflicts)
Constraint
computeConflicts
in class FlexibleConstraint
value
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic void weaken()
WeakeningConstraint
weaken
in interface WeakeningConstraint<Lecture,Placement>
public void weaken(Placement value)
WeakeningConstraint
weaken
in interface WeakeningConstraint<Lecture,Placement>
public void assigned(long iteration, Placement value)
Constraint
assigned
in class FlexibleConstraint