public class Rectangle extends Variable<Rectangle,Location>
Constructor and Description |
---|
Rectangle(String name,
int width,
int height,
int minX,
int maxX,
int minY,
int maxY,
Location initialLocation)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o)
Compares two rectangles (based on rectangle names)
|
int |
getHeight()
Returns height of the rectangle
|
int |
getMaxX() |
int |
getMaxY() |
int |
getMinX() |
int |
getMinY() |
String |
getName()
Returns name of the rectangle
|
int |
getProhibitedX() |
int |
getProhibitedY() |
int |
getWidth()
Returns width of the rectangle
|
boolean |
isProhibited(int x,
int y)
Returns true if the given location is prohibited.
|
void |
setBounds(int minX,
int maxX,
int minY,
int maxY)
Set the bounds (minimal and maximal values of X and Y coordinates).
|
void |
setProhibited()
Prohibits given initial location (for MPP).
|
void |
setProhibited(int x,
int y)
Prohibits given X and Y coordinates (for MPP).
|
String |
toString()
String representation (for printing and debugging purposes)
|
addContstraint, addVariableListener, assign, compareTo, constraints, constraintVariables, countAssignments, getAssignment, getBestAssignment, getBestAssignmentIteration, getDescription, getExtra, getId, getInitialAssignment, getModel, getVariableListeners, hardConstraints, hasAssignment, hashCode, hasInitialAssignment, hasValues, lastAssignmentIteration, lastUnassignmentIteration, removeContstraint, removeInitialValue, removeValue, removeVariableListener, setBestAssignment, setExtra, setInitialAssignment, setModel, setValues, softConstraints, unassign, values
public Rectangle(String name, int width, int height, int minX, int maxX, int minY, int maxY, Location initialLocation)
name
- variable's namewidth
- width of the rectangleheight
- height of the rectangleminX
- minimal X-coordinatemaxX
- maximal X-coordinateminY
- minimal Y-coordinatemaxY
- maximal Y-coordinateinitialLocation
- initial location (null if none)public void setProhibited(int x, int y)
public void setProhibited()
public boolean isProhibited(int x, int y)
public int getProhibitedX()
public int getProhibitedY()
public int getMinX()
public int getMaxX()
public int getMinY()
public int getMaxY()
public int getWidth()
public int getHeight()
public void setBounds(int minX, int maxX, int minY, int maxY)