Class ASite

  • All Implemented Interfaces:
    iSite, java.lang.Comparable<Site>
    Direct Known Subclasses:
    Site

    public class ASite
    extends JVertex
    implements java.lang.Comparable<Site>, iSite
    A site is a 2 dimensional point which has a weight.
    • Field Detail

      • weight

        protected double weight
      • percentage

        protected double percentage
      • neighbours

        protected java.util.ArrayList<Site> neighbours
      • preflowVector

        public Point2D preflowVector
        Preflow Extrapolation
    • Constructor Detail

      • ASite

        public ASite​(double x,
                     double y)
        Parameters:
        x - x-coordinate
        y - y-coordinate
      • ASite

        public ASite​(double x,
                     double y,
                     double weight)
        Parameters:
        x - x-coordinate
        y - y-coordinate
        weight - the weight of the site, where weight=radius*radius which is used for weighting
      • ASite

        public ASite​(double x,
                     double y,
                     double weight,
                     double percentage)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class JVertex
      • setNeighbours

        public void setNeighbours​(java.util.ArrayList<Site> list)
        Specified by:
        setNeighbours in interface iSite
      • getNeighbours

        public java.util.ArrayList<Site> getNeighbours()
        Specified by:
        getNeighbours in interface iSite
      • getWeight

        public double getWeight()
        Specified by:
        getWeight in interface iSite
      • setWeight

        public void setWeight​(double weight)
        Specified by:
        setWeight in interface iSite
      • setXY

        public void setXY​(double x,
                          double y)
        Specified by:
        setXY in interface iSite
      • setXYW

        public void setXYW​(double x,
                           double y,
                           double weight)
        Specified by:
        setXYW in interface iSite
      • setX

        public void setX​(double x)
        Specified by:
        setX in interface iSite
      • setY

        public void setY​(double y)
        Specified by:
        setY in interface iSite
      • compareTo

        public int compareTo​(Site b)
        The sites are first ordered according to the x-axis and then according to the y axis
        Specified by:
        compareTo in interface java.lang.Comparable<Site>
      • paint

        public void paint​(java.awt.Graphics2D g)
      • setPercentage

        public void setPercentage​(double percentage)
        Specified by:
        setPercentage in interface iSite
      • getPercentage

        public double getPercentage()
        Specified by:
        getPercentage in interface iSite
      • distance

        public double distance​(Site point)
        Euclid
        Parameters:
        point -
        Returns:
      • distanceCircles

        public double distanceCircles​(Site point)