package cs437.som.neighborhood;

import cs437.som.NeightborhoodWidthFunction;

/**
 * Hyperbolic neighborhood width strategy for self-organizing map.
 */
public class HyperbolicNeighborhoodWidthFunction implements NeightborhoodWidthFunction {
    private double expectedIterations;

    public void setExpectedIterations(int expectedIterations) {
        this.expectedIterations = expectedIterations;
    }

    public double neighborhoodWidth(int iteration) {
        return expectedIterations / (expectedIterations + iteration);
    }

    @Override
    public String toString() {
        return "HyperbolicNeighborhoodWidthFunction";
    }
}

@@ -143,16 +143,240 @@
 ng map.%0A
+ *%0A * The exact behavior follows the formula:%0A *      w_i / (t + t_max)%0A *  where%0A *      w_i   is the initial width of the neighborhood%0A *      t     is the current iteration%0A *      t_max is the maximum expected iteration%0A
  */%0Apubl
@@ -497,16 +497,22 @@
 erations
+ = 0.0
 ;%0A%0A    p

Add formula comment to hyperbolic NW class.