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.
-
-
Field Summary
Fields Modifier and Type Field Description public final static double
DEFAULT_ADJUSTMENT
public final static double
DEFAULT_MAXRANGE
public final static double
DEFAULT_MINRANGE
-
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)
-
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 metresminrange
- minimum radius in metresmaxrange
- maximum radius in metresnum
- preferred number of neighborstolerance
- 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 metresminrange
- minimum radius in metresmaxrange
- maximum radius in metresnum
- preferred number of neighborstolerance
- 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 decreasedadjustment
- 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 metresminrange
- minimum radius in metresnum
- preferred number of neighborstolerance
- 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 metresminrange
- minimum radius in metresnum
- preferred number of neighborstolerance
- 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 decreasedadjustment
- 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 metresnum
- preferred number of neighborstolerance
- 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 metresnum
- preferred number of neighborstolerance
- 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 decreasedadjustment
- the amount of metres the range will be changed if out of the bounds
-
-
Method Detail
-
computeNeighborhood
final Neighborhood<T> computeNeighborhood(Node<T> center, Environment<T, P> environment)
Subclasses may change the way a neighborhood is computed.
-
-
-
-