public class BreakFlexibleConstraint extends FlexibleConstraint
FlexibleConstraint.Block, FlexibleConstraint.FlexibleConstraintType, FlexibleConstraint.PlacementTimeComparator
iConstraintType, iReference, iWeeks
iAssignedVariables, iConstraintListeners, iId
Constructor and Description |
---|
BreakFlexibleConstraint(Long id,
String owner,
String preference,
String reference) |
Modifier and Type | Method and Description |
---|---|
void |
computeConflicts(Placement value,
Set<Placement> conflicts)
The only method which has to be implemented by any constraint.
|
List<FlexibleConstraint.Block> |
getBreakBlocks(int dayCode,
Set<Placement> conflicts,
Placement value,
HashMap<Lecture,Placement> assignments,
BitSet week)
Creates a list of consecutive blocks with back-to-back classes.
|
double |
getNrViolations(Set<Placement> conflicts,
HashMap<Lecture,Placement> assignments) |
assigned, 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 BreakFlexibleConstraint(Long id, String owner, String preference, String reference)
owner
- identifier of distribution preference the constraint was created forpreference
- time preference ("R" for required, "P" for prohibited, "-2",
"-1", "1", "2" for soft preference)reference
- parameters of the constraint in String formpublic 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 List<FlexibleConstraint.Block> getBreakBlocks(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 placements