|
||||||||||
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.ifs.example.rpp.ResourceConstraint
public class ResourceConstraint
Resource constraint (rectangular area where the rectangles are to be placed). It prohibits overlapping of the placed rectangles.
Field Summary |
---|
Fields inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
iAssignedVariables, iConstraintListeners, iId |
Constructor Summary | |
---|---|
ResourceConstraint(int width,
int height)
Constructor. |
Method Summary | |
---|---|
void |
assigned(long iteration,
Value value)
Notification, when a rectangle is placed. |
void |
check()
|
void |
computeConflicts(Value value,
Set conflicts)
Compute conflicts with the given placement of the rectangle. |
boolean |
inConflict(Value value)
Returns true if there is a rectangle which overlaps with the given assignment. |
boolean |
isConsistent(Value value1,
Value value2)
Returns true if the given rectangles (assignments) do not overlap. |
String |
toString()
String representation of the constraint (for debugging and printing purposes). |
void |
unassigned(long iteration,
Value value)
Notification, when a rectangle is unplaced. |
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
addConstraintListener, addVariable, assignedVariables, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, getName, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variables |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ResourceConstraint(int width, int height)
width
- area widthheight
- area heightMethod Detail |
---|
public void computeConflicts(Value value, Set conflicts)
computeConflicts
in class Constraint
value
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Value value)
inConflict
in class Constraint
public boolean isConsistent(Value value1, Value value2)
isConsistent
in class Constraint
public void assigned(long iteration, Value value)
assigned
in class Constraint
public void unassigned(long iteration, Value value)
unassigned
in class Constraint
public void check()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |