|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.ifs.model.Constraint net.sf.cpsolver.coursett.constraint.SpreadConstraint
public class SpreadConstraint
Spread given set of classes in time as much as possible.
See DepartmentSpreadConstraint
for more details.
Field Summary | |
---|---|
static boolean |
USE_MOST_IMPROVEMENT_ADEPTS
|
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
iAssignedVariables, iConstraintListeners, iId |
Constructor Summary | |
---|---|
SpreadConstraint(DataProperties config,
String name)
|
|
SpreadConstraint(String name,
double spreadFactor,
int unassignmentsToWeaken,
boolean interactiveMode)
|
Method Summary | |
---|---|
void |
addVariable(Variable variable)
Add a variable to this constraint |
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. |
Placement |
getAdept(Placement placement,
int[][] nrCourses,
Set conflicts)
|
Vector[][] |
getCourses()
|
int[][] |
getMaxCourses()
|
int |
getMaxPenalty(Placement placement)
|
String |
getName()
Constraint's name -- for printing purposes |
int[][] |
getNrCourses()
|
int |
getPenalty()
Department balancing penalty for this department |
int |
getPenalty(Placement placement)
Department balancing penalty of the given placement |
int |
getPenaltyEstimate()
|
boolean |
inConflict(Value value)
Returns true if the given assignment is inconsistent with the existing assignments respecting this constraint. |
void |
init()
Initialize constraint (to be called after all variables are added to this constraint) |
boolean |
isConsistent(Value value1,
Value value2)
Returns true if the given assignments are consistent respecting this constraint. |
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, assignedVariables, 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 boolean USE_MOST_IMPROVEMENT_ADEPTS
Constructor Detail |
---|
public SpreadConstraint(String name, double spreadFactor, int unassignmentsToWeaken, boolean interactiveMode)
public SpreadConstraint(DataProperties config, String name)
Method Detail |
---|
public void init()
public Placement getAdept(Placement placement, int[][] nrCourses, Set conflicts)
public void computeConflicts(Value value, Set conflicts)
Constraint
computeConflicts
in class Constraint
value
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Value value)
Constraint
MacPropagation
).
inConflict
in class Constraint
public boolean isConsistent(Value value1, Value value2)
Constraint
MacPropagation
).
isConsistent
in class Constraint
public void weaken()
WeakeningConstraint
weaken
in interface WeakeningConstraint
public void assigned(long iteration, Value value)
Constraint
assigned
in class Constraint
public void unassigned(long iteration, Value value)
Constraint
unassigned
in class Constraint
public String getName()
Constraint
getName
in class Constraint
public String toString()
toString
in class Object
public int getPenalty()
public int getPenaltyEstimate()
public int getMaxPenalty(Placement placement)
public int getPenalty(Placement placement)
public int[][] getMaxCourses()
public int[][] getNrCourses()
public Vector[][] getCourses()
public void addVariable(Variable variable)
Constraint
addVariable
in class Constraint
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |