Class LinearWeightedExtendedNeighborhood

  • All Implemented Interfaces:
    WeightedNeighborSetPredicate

    public class LinearWeightedExtendedNeighborhood
    extends java.lang.Object
    implements WeightedNeighborSetPredicate
    Neighborhood obtained by computing the k-fold closure of an existing neighborhood. Objects are weighted linearly by their distance: the object itself has a weight of 1 and this decreases linearly to 1/(n+1) for the nth-step neighbors.

    TODO: make actual weighting parameterizable?

    Since:
    0.4.0
    Author:
    Erich Schubert
    • Field Detail

      • steps

        private int steps
        The number of steps to extend to.
    • Constructor Detail

      • LinearWeightedExtendedNeighborhood

        public LinearWeightedExtendedNeighborhood​(NeighborSetPredicate inner,
                                                  int steps)
        Constructor.
        Parameters:
        inner - Inner neighborhood
        steps - Number of steps to expand
    • Method Detail

      • computeWeight

        private double computeWeight​(int tsteps)
        Compute the weight from the number of steps needed.
        Parameters:
        tsteps - steps to target
        Returns:
        weight