jhpro.nnet.jknnl
Class HexagonalTopology
- java.lang.Object
-
- jhpro.nnet.jknnl.HexagonalTopology
-
- All Implemented Interfaces:
- TopologyModel
public class HexagonalTopology extends java.lang.Object implements TopologyModel
HexagonalTopology is a topology where neurons are placed in hexagonal net. Even rows are shifted on place to right.
-
-
Constructor Summary
Constructors Constructor and Description HexagonalTopology(int row, int col)Creates a new instance of HexagonalTopology with specified numbers of rows and columns.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetColNumber()Return number of columnsjava.util.ArrayListgetConnectedNeurons(int neuronNumber)Return ArrayList of neurons connected to neuron with neuron Numberjava.util.TreeMapgetNeighbourhood(int neuronNumber)Return TreeMap containing information about neuron and distance to neuron for which neighbourhood is calculatedCoordsgetNeuronCoordinate(int neuronNumber)Return Coord object contains information about neuron co-ordinate in Hexagonal TopologyintgetNeuronNumber(Coords coords)Return neuron number of specyfied co-ordianteintgetNumbersOfNeurons()Return number of neurons in topology.intgetRadius()Return radius for calculate neighbourhoodintgetRowNumber()Return number of rowsvoidsetColNumber(int colNumber)Set number of columnsvoidsetRadius(int radius)Set radiusvoidsetRowNumber(int rowNumber)Set number of rowsjava.lang.StringtoString()Returns a string representation of the topology.
Neuron number nr is connected with: [ list of neurons ]
-
-
-
Constructor Detail
-
HexagonalTopology
public HexagonalTopology(int row, int col)Creates a new instance of HexagonalTopology with specified numbers of rows and columns. Radius is default set to 0- Parameters:
row- number of rowscol- number of columns
-
-
Method Detail
-
setRowNumber
public void setRowNumber(int rowNumber)
Set number of rows- Specified by:
setRowNumberin interfaceTopologyModel- Parameters:
rowNumber- numbers of rows
-
setColNumber
public void setColNumber(int colNumber)
Set number of columns- Specified by:
setColNumberin interfaceTopologyModel- Parameters:
colNumber- numbers of columns
-
getRowNumber
public int getRowNumber()
Return number of rows- Specified by:
getRowNumberin interfaceTopologyModel- Returns:
- numbers of rows
-
getColNumber
public int getColNumber()
Return number of columns- Specified by:
getColNumberin interfaceTopologyModel- Returns:
- number of columns
-
setRadius
public void setRadius(int radius)
Set radius- Specified by:
setRadiusin interfaceTopologyModel- Parameters:
radius- Radius
-
getRadius
public int getRadius()
Return radius for calculate neighbourhood- Specified by:
getRadiusin interfaceTopologyModel- Returns:
- radius
-
getConnectedNeurons
public java.util.ArrayList getConnectedNeurons(int neuronNumber)
Return ArrayList of neurons connected to neuron with neuron Number- Specified by:
getConnectedNeuronsin interfaceTopologyModel- Parameters:
neuronNumber- neuron number- Returns:
- list of connected neurons
- See Also:
ArrayList
-
getNumbersOfNeurons
public int getNumbersOfNeurons()
Return number of neurons in topology.- Specified by:
getNumbersOfNeuronsin interfaceTopologyModel- Returns:
- number of neurons
-
getNeighbourhood
public java.util.TreeMap getNeighbourhood(int neuronNumber)
Return TreeMap containing information about neuron and distance to neuron for which neighbourhood is calculated- Specified by:
getNeighbourhoodin interfaceTopologyModel- Parameters:
neuronNumber- neuron number- Returns:
- Tree map containn neuron number and distance
- See Also:
TreeMap
-
getNeuronNumber
public int getNeuronNumber(Coords coords)
Return neuron number of specyfied co-ordiante- Specified by:
getNeuronNumberin interfaceTopologyModel- Parameters:
coords- neuron coordinate- Returns:
- neuron number
-
getNeuronCoordinate
public Coords getNeuronCoordinate(int neuronNumber)
Return Coord object contains information about neuron co-ordinate in Hexagonal Topology- Specified by:
getNeuronCoordinatein interfaceTopologyModel- Parameters:
neuronNumber- neuron number- Returns:
- coords object
-
toString
public java.lang.String toString()
Returns a string representation of the topology.
Neuron number nr is connected with: [ list of neurons ]- Specified by:
toStringin interfaceTopologyModel- Overrides:
toStringin classjava.lang.Object- Returns:
- string representation of the topology.
-
-
DMelt 3.0 © DataMelt by jWork.ORG