Package placement
Class Constraint
java.lang.Object
placement.Constraint
- All Implemented Interfaces:
Comparable<Constraint>
public class Constraint extends Object implements Comparable<Constraint>
- Author:
- dwyer_2 To change the template for this generated type comment go to Window - Preferences - Java - Code Style - Code Templates
-
Field Summary
Fields Modifier and Type Field Description Color
colour
double
lagrangeMultiplier
-
Method Summary
Modifier and Type Method Description int
compareTo(Constraint c)
If the constraint of the argument is more violated than this then it is considered greater (and we return 1).void
delete()
remove all traces of cboolean
isTight()
Variable
neighbour(Variable v)
boolean
sameContainers(Constraint c)
String
toString()
-
Field Details
-
colour
-
lagrangeMultiplier
public double lagrangeMultiplier
-
-
Method Details
-
toString
-
neighbour
- Parameters:
v
-- Returns:
- neighbour of v in this constraint
-
sameContainers
- Parameters:
c
- another constraint- Returns:
- true if c is between the same blocks as this
-
delete
public void delete()remove all traces of c -
isTight
public boolean isTight() -
compareTo
If the constraint of the argument is more violated than this then it is considered greater (and we return 1). NOTE: constraints within the same block are treated as having infinite violated amount. This is a hack so that the pairing heaps used to manage in and out constraints are not messed up when they contain internal constraints (which do not move relative to the block)- Specified by:
compareTo
in interfaceComparable<Constraint>
- Parameters:
c
- Constraint to compare against- Returns:
- 1 if c more violated than this, 0 if equal, -1 if less than
-