databionics.esom.neighborhood
Class Neighborhood

java.lang.Object
  extended by databionics.esom.neighborhood.Neighborhood
Direct Known Subclasses:
BubbleNeighborhood, CachedNeighborhood

public abstract class Neighborhood
extends java.lang.Object

Abstract base class for neighborhood kernels on a SOM grid. Subclasses need to override the calculate(int distance) method.

On a grid only integer distances from the center need to be considered. The kernels are assumed to be radial symmetric, so only a one dimensional array for the weights is needed.


Field Summary
protected static org.apache.log4j.Logger log
          interface to log4j system
protected  int radius
          maximum distance from bestmatch on grid to be considered
protected  double scaling
          scaling factor for all weights
 
Constructor Summary
Neighborhood()
          Create a new neighborhood object
Neighborhood(int radius, double scaling)
          Create a new neighborhood object
 
Method Summary
protected abstract  double calculate(int distance)
          Calculate the weight value for this distance.
 double get(int distance)
          Get weight for distance on grid from kernel center
abstract  void init()
          Initialize the neighborhood.
 void setRadius(int radius)
          Set the maximum distance from bestmatch on grid to be considered
 void setScaling(double scaling)
          Set the scaling factor for all weights
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log
interface to log4j system


radius

protected int radius
maximum distance from bestmatch on grid to be considered


scaling

protected double scaling
scaling factor for all weights

Constructor Detail

Neighborhood

public Neighborhood()
Create a new neighborhood object


Neighborhood

public Neighborhood(int radius,
                    double scaling)
Create a new neighborhood object

Parameters:
radius - radius of kernel
scaling - scaling factor for all weights
Method Detail

calculate

protected abstract double calculate(int distance)
Calculate the weight value for this distance. Override this method in subclasses.

Parameters:
distance - distance from center ([0..radius])
Returns:
weight for this distance

init

public abstract void init()
Initialize the neighborhood. Call this after setting radius and scaling


get

public double get(int distance)
Get weight for distance on grid from kernel center

Parameters:
distance - distance from center
Returns:
weight for this distance

setRadius

public void setRadius(int radius)
Set the maximum distance from bestmatch on grid to be considered

Parameters:
radius - radius

setScaling

public void setScaling(double scaling)
Set the scaling factor for all weights

Parameters:
scaling - scaling


Copyright © 2005-2006 Databionics Research Group. All Rights Reserved.