|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectifs.model.Constraint
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.
| 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 ifs.model.Constraint |
|---|
addConstraintListener, addVariable, assignedVariables, countAssignedVariables, countVariables, getDescription, getId, getInfo, getModel, getName, hashCode, isHard, removeConstraintListener, removeVariable, setModel, variables |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceConstraint(int width,
int height)
width - area widthheight - area height| Method Detail |
|---|
public void computeConflicts(Value value,
Set conflicts)
computeConflicts in class Constraintvalue - 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 Constraintpublic 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 | |||||||||