package cs437.som.membership;

import cs437.som.NeighborhoodMembershipFunction;

import java.security.SecureRandom;
import java.util.Random;

public class RandomNeighborhoodMembershipFunction implements NeighborhoodMembershipFunction {
    private Random r = new SecureRandom();

    @Override
    public double neighborhoodMembership(double distance, double width) {
        if (distance < width)
            return r.nextDouble();
        else
            return 0;
    }
}

@@ -135,16 +135,173 @@
 andom;%0A%0A
+/**%0A * Random neighborhood membership strategy.%0A *%0A * Returns a random double in %5B0, 1%5D if the neuron is in the BMU's neighborhood%0A * or 0 if it is not.%0A */%0A
 public c

Document RandomNeighborhoodMembershipFunction.