|
||||||||||
| 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.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(Lecture lecture)
Add a variable to this constraint |
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. |
Placement |
getAdept(Placement placement,
int[][] nrCourses,
Set<Placement> conflicts)
|
List<Placement>[][] |
getCourses()
|
protected Criterion<Lecture,Placement> |
getCriterion()
|
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(Placement placement)
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(Placement p1,
Placement p2)
Returns true if the given assignments are consistent respecting this constraint. |
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, 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 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 |
|---|
protected Criterion<Lecture,Placement> getCriterion()
public void init()
public Placement getAdept(Placement placement,
int[][] nrCourses,
Set<Placement> conflicts)
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)
ConstraintMacPropagation).
inConflict in class Constraint<Lecture,Placement>
public boolean isConsistent(Placement p1,
Placement p2)
ConstraintMacPropagation).
isConsistent in class Constraint<Lecture,Placement>public void weaken()
WeakeningConstraint
weaken in interface WeakeningConstraint<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 getName()
Constraint
getName in class Constraint<Lecture,Placement>public String toString()
toString in class Objectpublic int getPenalty()
public int getPenaltyEstimate()
public int getMaxPenalty(Placement placement)
public int getPenalty(Placement placement)
public int[][] getMaxCourses()
public int[][] getNrCourses()
public List<Placement>[][] getCourses()
public void addVariable(Lecture lecture)
Constraint
addVariable in class Constraint<Lecture,Placement>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 | |||||||||