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 Details

    • colour

      public Color colour
    • lagrangeMultiplier

      public double lagrangeMultiplier
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • neighbour

      public Variable neighbour​(Variable v)
      Parameters:
      v -
      Returns:
      neighbour of v in this constraint
    • sameContainers

      public boolean sameContainers​(Constraint c)
      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

      public int compareTo​(Constraint c)
      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 interface Comparable<Constraint>
      Parameters:
      c - Constraint to compare against
      Returns:
      1 if c more violated than this, 0 if equal, -1 if less than