|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.cpsolver.ifs.model.Constraint
net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime
public class MinimizeNumberOfUsedGroupsOfTime
Minimize number of used groups of time within a set of classes.
This constraint implements the following distribution/group constraints:
MIN_GRUSE(10x1h) (Minimize Use Of 1h Groups)
Minimize number of groups of time that are used by the given classes. The time is spread into the following 10 groups of one hour: 7:30a-8:30a, 8:30a-9:30a, 9:30a-10:30a, ... 4:30p-5:30p.
MIN_GRUSE(5x2h) (Minimize Use Of 2h Groups)
Minimize number of groups of time that are used by the given classes. The time is spread into the following 5 groups of two hours: 7:30a-9:30a, 9:30a-11:30a, 11:30a-1:30p, 1:30p-3:30p, 3:30p-5:30p.
MIN_GRUSE(3x3h) (Minimize Use Of 3h Groups)
Minimize number of groups of time that are used by the given classes. The time is spread into the following 3 groups: 7:30a-10:30a, 10:30a-2:30p, 2:30p-5:30p.
MIN_GRUSE(2x5h) (Minimize Use Of 5h Groups)
Minimize number of groups of time that are used by the given classes. The time is spread into the following 2 groups: 7:30a-12:30a, 12:30a-5:30p.
| Field Summary | |
|---|---|
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
|
| Fields inherited from class net.sf.cpsolver.ifs.model.Constraint |
|---|
iAssignedVariables, iId |
| Constructor Summary | |
|---|---|
MinimizeNumberOfUsedGroupsOfTime(DataProperties config,
String name,
net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] groupsOfTime)
|
|
| Method Summary | |
|---|---|
void |
assigned(long iteration,
Value value)
Given value is to be assigned to its varable. |
void |
computeConflicts(Value value,
Set 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(Value value)
|
boolean |
inConflict(Value value)
Returns true if the given assignment is inconsistent with the existing assignments respecting this constraint. |
boolean |
isConsistent(Value value1,
Value value2)
Returns true if the given assignments are consistent respecting this constraint. |
boolean |
isEnabled()
|
boolean |
isOverLimit(Value value)
|
void |
setEnabled(boolean enabled)
|
String |
toString()
|
void |
unassigned(long iteration,
Value value)
Given value is unassigned from its varable. |
void |
weaken()
Weaken the constraint. |
| Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
|---|
addConstraintListener, addVariable, assignedVariables, constraintListeners, countAssignedVariables, countVariables, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variables |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public MinimizeNumberOfUsedGroupsOfTime(DataProperties config,
String name,
net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] groupsOfTime)
| Method Detail |
|---|
public int currentUsage()
public void weaken()
WeakeningConstraint
weaken in interface WeakeningConstraintpublic boolean isOverLimit(Value value)
public int getOverLimit(Value value)
public int estimateLimit()
public void computeConflicts(Value value,
Set conflicts)
Constraint
computeConflicts in class Constraintvalue - value to be assigned to its varaibleconflicts - resultant set of conflicting valuespublic boolean inConflict(Value value)
ConstraintMacPropagation).
inConflict in class Constraint
public boolean isConsistent(Value value1,
Value value2)
ConstraintMacPropagation).
isConsistent in class Constraint
public void assigned(long iteration,
Value value)
Constraint
assigned in class Constraint
public void unassigned(long iteration,
Value value)
Constraint
unassigned in class Constraintpublic String getConstraintName()
public String getName()
Constraint
getName in class Constraintpublic void setEnabled(boolean enabled)
public boolean isEnabled()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||