| Constructor and Description |
|---|
HexagonTopology(int rows,
int columns)
Creates the SOM Trainer.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
arrangeNeurons()
Arranges the output neurons of the net according to the topology, i.e., the positions of neurons are set
and the neurons get an ID, which can be used to identify its position in the map.
|
protected void |
clearMap()
Clears the map (set to EMPTY).
|
HexagonTopology |
clone()
A deep clone.
|
void |
fromXML(org.jdom2.Element element)
Reads attributes from XML tree.
|
Neuron |
getLowerLeft(int id)
Returns the lower left neighbor neuron, if there.
|
Neuron |
getLowerRight(int id)
Returns the lower right neighbor neuron, if there.
|
int[] |
getNeurons()
Returns the dimensions of the map.
|
Neuron |
getRight(int id)
Returns the right neighbor neuron, if there.
|
double[] |
getSizes()
Returns the size (length) of each dimension of the map.
|
int |
getTotalNeurons()
Returns the total number of map neurons.
|
protected void |
searchNeighbors(int id,
int radius)
Searches direct hexagonal neighbors of the given center neuron.
|
protected void |
setMapValue(int index,
int value)
Sets a map value at the spot corresponding to the neuron index.
|
org.jdom2.Element |
toXML(org.jdom2.Element element)
Writes specific attributes to XML tree.
|
addNeighbor, getNeighbors, getNet, setNetpublic HexagonTopology(int rows,
int columns)
public HexagonTopology clone()
public int[] getNeurons()
getNeurons in class Topologypublic double[] getSizes()
public boolean arrangeNeurons()
arrangeNeurons in class Topologyprotected void setMapValue(int index,
int value)
setMapValue in class Topologyindex - a neuron indexvalue - the map valuepublic int getTotalNeurons()
getTotalNeurons in class Topologyprotected void clearMap()
protected void searchNeighbors(int id,
int radius)
searchNeighbors in class Topologyid - the center neuron indexradius - the neighborhood radiuspublic void fromXML(org.jdom2.Element element)
Storableelement - a JDOM elementpublic org.jdom2.Element toXML(org.jdom2.Element element)
public Neuron getRight(int id)
id - the neuron IDpublic Neuron getLowerLeft(int id)
id - the neuron IDpublic Neuron getLowerRight(int id)
id - the neuron ID