public class MinimizeNumberOfUsedGroupsOfTime extends Constraint<Lecture,Placement> implements WeakeningConstraint<Lecture,Placement>
Modifier and Type | Field and Description |
---|---|
static net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] |
sGroups10of1h |
static net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] |
sGroups2of5h |
static net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] |
sGroups3of3h |
static net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] |
sGroups5of2h |
iAssignedVariables, iConstraintListeners, iId
Constructor and Description |
---|
MinimizeNumberOfUsedGroupsOfTime(DataProperties config,
String name,
net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] groupsOfTime) |
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 |
currentUsage() |
int |
estimateLimit() |
String |
getConstraintName() |
String |
getName()
Constraint's name -- for printing purposes
|
int |
getOverLimit(Placement placement) |
boolean |
inConflict(Placement placement)
Returns true if the given assignment is inconsistent with the existing
assignments respecting this constraint.
|
boolean |
isConsistent(Placement value1,
Placement value2)
Returns true if the given assignments are consistent respecting this
constraint.
|
boolean |
isEnabled() |
boolean |
isOverLimit(Placement placement) |
void |
setEnabled(boolean enabled) |
String |
toString() |
void |
unassigned(long iteration,
Placement placement)
Given value is unassigned from its variable.
|
void |
weaken()
Weaken the constraint.
|
void |
weaken(Placement value)
Weaken the constraint enough so that it can assign the given
value.
|
addConstraintListener, addVariable, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variables
public static net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] sGroups2of5h
public static net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] sGroups3of3h
public static net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] sGroups5of2h
public static net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] sGroups10of1h
public MinimizeNumberOfUsedGroupsOfTime(DataProperties config, String name, net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] groupsOfTime)
public int currentUsage()
public void weaken()
WeakeningConstraint
weaken
in interface WeakeningConstraint<Lecture,Placement>
public boolean isOverLimit(Placement placement)
public int getOverLimit(Placement placement)
public int estimateLimit()
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 value1, Placement value2)
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 String getConstraintName()
public String getName()
Constraint
getName
in class Constraint<Lecture,Placement>
public void setEnabled(boolean enabled)
public boolean isEnabled()
public void weaken(Placement value)
WeakeningConstraint
weaken
in interface WeakeningConstraint<Lecture,Placement>