public class ResourceConstraint extends Constraint<Rectangle,Location>
iAssignedVariables, iConstraintListeners, iId
Constructor and Description |
---|
ResourceConstraint(int width,
int height)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
addConstraintListener, addVariable, assignedVariables, compareTo, constraintListeners, countAssignedVariables, countVariables, equals, getDescription, getId, getModel, getName, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variables
public ResourceConstraint(int width, int height)
width
- area widthheight
- area heightpublic 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()