|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.cpsolver.ifs.model.Constraint<Rectangle,Location>
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,
Location placement)
Notification, when a rectangle is placed. |
void |
check()
|
void |
computeConflicts(Location placement,
Set<Location> conflicts)
Compute conflicts with the given placement of the rectangle. |
boolean |
inConflict(Location placement)
Returns true if there is a rectangle which overlaps with the given assignment. |
boolean |
isConsistent(Location p1,
Location p2)
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,
Location placement)
Notification, when a rectangle is unplaced. |
Methods inherited from class net.sf.cpsolver.ifs.model.Constraint |
---|
addConstraintListener, addVariable, assignedVariables, compareTo, 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(Location placement, Set<Location> conflicts)
computeConflicts
in class Constraint<Rectangle,Location>
placement
- value to be assigned to its varaibleconflicts
- resultant set of conflicting valuespublic boolean inConflict(Location placement)
inConflict
in class Constraint<Rectangle,Location>
public boolean isConsistent(Location p1, Location p2)
isConsistent
in class Constraint<Rectangle,Location>
public void assigned(long iteration, Location placement)
assigned
in class Constraint<Rectangle,Location>
public void unassigned(long iteration, Location placement)
unassigned
in class Constraint<Rectangle,Location>
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 |