public class BreakFlexibleConstraint extends FlexibleConstraint
iConstraintType, iPreference, iReference, iWeeks
|Constructor and Description|
|Modifier and Type||Method and Description|
The only method which has to be implemented by any constraint.
Creates a list of consecutive blocks with back-to-back classes.
Return current number of violations.
createAssignmentContext, getCurrentPreference, getName, getOwner, getPrologPreference, getReference, getRelevantPlacements, getType, getWeeks, isConsistent, isHard, mergeToBlocks, toString
assigned, getAssignmentContextReference, getContext, getContext, setAssignmentContextReference, setModel, unassigned
addConstraintListener, addVariable, assignedVariables, compareTo, computeConflictsNoForwardCheck, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, inConflict, removeConstraintListener, removeVariable, variables
public BreakFlexibleConstraint(Long id, String owner, String preference, String reference)
id- constraint unique id
owner- identifier of distribution preference the constraint was created for
preference- time preference ("R" for required, "P" for prohibited, "-2", "-1", "1", "2" for soft preference)
reference- parameters of the constraint in String form
public void computeConflicts(Assignment<Lecture,Placement> assignment, Placement value, Set<Placement> conflicts)
public List<FlexibleConstraint.Block> getBreakBlocks(Assignment<Lecture,Placement> assignment, int dayCode, Set<Placement> conflicts, Placement value, HashMap<Lecture,Placement> assignments, BitSet week)
assignment- current assignment
dayCode- days of week
conflicts- conflicting assignment
value- placement in question
assignments- other considered assignments
week- selected week
public double getNrViolations(Assignment<Lecture,Placement> assignment, Set<Placement> conflicts, HashMap<Lecture,Placement> assignments)