Class AdaptiveRange

  • All Implemented Interfaces:
    it.unibo.alchemist.model.LinkingRule , java.io.Serializable

    
    public class AdaptiveRange<T, P extends Position<P>>
    extends ConnectWithinDistance<T, P>
                        

    This linking rule dynamically searches for the best radius for each device, in such a way that it connects to a certain number of devices.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
      AdaptiveRange(double radius, double minrange, double maxrange, int num, int tolerance)
      AdaptiveRange(double radius, double minrange, double maxrange, int num, int tolerance, double adjustment)
      AdaptiveRange(double radius, double minrange, int num, int tolerance)
      AdaptiveRange(double radius, double minrange, int num, int tolerance, double adjustment)
      AdaptiveRange(double radius, int num, int tolerance)
      AdaptiveRange(double radius, int num, int tolerance, double adjustment)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Neighborhood<T> computeNeighborhood(Node<T> center, Environment<T, P> environment) Subclasses may change the way a neighborhood is computed.
      • Methods inherited from class it.unibo.alchemist.model.linkingrules.AbstractLocallyConsistentLinkingRule

        isLocallyConsistent, toString
      • Methods inherited from class it.unibo.alchemist.model.LinkingRule

        computeNeighborhood, isLocallyConsistent
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AdaptiveRange

        AdaptiveRange(double radius, double minrange, double maxrange, int num, int tolerance)
        Parameters:
        radius - default radius in metres
        minrange - minimum radius in metres
        maxrange - maximum radius in metres
        num - preferred number of neighbors
        tolerance - if the number of neighbors is smaller than num-tolerance, the radius is increased; if the number of neighbors is higher than num+tolerance, the radius is decreased
      • AdaptiveRange

        AdaptiveRange(double radius, double minrange, double maxrange, int num, int tolerance, double adjustment)
        Parameters:
        radius - default radius in metres
        minrange - minimum radius in metres
        maxrange - maximum radius in metres
        num - preferred number of neighbors
        tolerance - if the number of neighbors is smaller than num-tolerance, the radius is increased; if the number of neighbors is higher than num+tolerance, the radius is decreased
        adjustment - the amount of metres the range will be changed if out of the bounds
      • AdaptiveRange

        AdaptiveRange(double radius, double minrange, int num, int tolerance)
        Parameters:
        radius - default radius in metres
        minrange - minimum radius in metres
        num - preferred number of neighbors
        tolerance - if the number of neighbors is smaller than num-tolerance, the radius is increased; if the number of neighbors is higher than num+tolerance, the radius is decreased
      • AdaptiveRange

        AdaptiveRange(double radius, double minrange, int num, int tolerance, double adjustment)
        Parameters:
        radius - default radius in metres
        minrange - minimum radius in metres
        num - preferred number of neighbors
        tolerance - if the number of neighbors is smaller than num-tolerance, the radius is increased; if the number of neighbors is higher than num+tolerance, the radius is decreased
        adjustment - the amount of metres the range will be changed if out of the bounds
      • AdaptiveRange

        AdaptiveRange(double radius, int num, int tolerance)
        Parameters:
        radius - default radius in metres
        num - preferred number of neighbors
        tolerance - if the number of neighbors is smaller than num-tolerance, the radius is increased; if the number of neighbors is higher than num+tolerance, the radius is decreased
      • AdaptiveRange

        AdaptiveRange(double radius, int num, int tolerance, double adjustment)
        Parameters:
        radius - default radius in metres
        num - preferred number of neighbors
        tolerance - if the number of neighbors is smaller than num-tolerance, the radius is increased; if the number of neighbors is higher than num+tolerance, the radius is decreased
        adjustment - the amount of metres the range will be changed if out of the bounds