package cs437.som.membership;

import cs437.som.NeighborhoodMembershipFunction;

/**
 * Neighborhood membership strategy for self-organizing maps. Returns a scalar
 * linearly proportional to distance.
 */
public class LinearNeighborhoodMembershipFunction implements NeighborhoodMembershipFunction {
    public double neighborhoodMembership(double distance, double width) {
        if (distance < width)
            return (width - distance) / width;
        else
            return 0;
    }
}

@@ -292,16 +292,31 @@
 nction %7B
+%0A%0A    @Override
 %0A    pub

Add @Override to LinearNeighborhoodMembershipFunction method.