|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cpsolver.ifs.model.Constraint<Lecture,Placement>
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, iConstraintListeners, iId |
Constructor Summary | |
---|---|
MinimizeNumberOfUsedGroupsOfTime(DataProperties config,
String name,
net.sf.cpsolver.coursett.constraint.MinimizeNumberOfUsedGroupsOfTime.GroupOfTime[] groupsOfTime)
|
Method Summary | |
---|---|
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. |
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
addConstraintListener, addVariable, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variables |
Methods inherited from class java.lang.Object |
---|
clone, 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 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 String toString()
toString
in class Object
public void weaken(Placement value)
WeakeningConstraint
weaken
in interface WeakeningConstraint<Lecture,Placement>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |