public class NeuronString
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
private static class |
NeuronString.SerializationProxy
Serialization.
|
Modifier and Type | Field and Description |
---|---|
private long[] |
identifiers
Mapping of the 1D coordinate to the neuron identifiers
(attributed by the
network instance). |
private Network |
network
Underlying network.
|
private int |
size
Number of neurons.
|
private boolean |
wrap
Wrap.
|
Constructor and Description |
---|
NeuronString(boolean wrap,
double[][] featuresList)
Constructor with restricted access, solely used for deserialization.
|
NeuronString(int num,
boolean wrap,
FeatureInitializer[] featureInit)
Creates a one-dimensional network:
Each neuron not located on the border of the mesh has two
neurons linked to it.
|
Modifier and Type | Method and Description |
---|---|
private void |
createLinks()
Creates the neighbour relationships between neurons.
|
double[] |
getFeatures(int i)
Retrieves the features set from the neuron at location
i in the map. |
Network |
getNetwork()
Retrieves the underlying network.
|
int |
getSize()
Gets the number of neurons.
|
private void |
readObject(java.io.ObjectInputStream in)
Prevents proxy bypass.
|
private java.lang.Object |
writeReplace()
Custom serialization.
|
private final Network network
private final int size
private final boolean wrap
private final long[] identifiers
network
instance).NeuronString(boolean wrap, double[][] featuresList)
wrap
- Whether to wrap the dimension (i.e the first and last
neurons will be linked together).featuresList
- Arrays that will initialize the features sets of
the network's neurons.NumberIsTooSmallException
- if num < 2
.public NeuronString(int num, boolean wrap, FeatureInitializer[] featureInit)
num
- Number of neurons.wrap
- Whether to wrap the dimension (i.e the first and last
neurons will be linked together).featureInit
- Arrays that will initialize the features sets of
the network's neurons.NumberIsTooSmallException
- if num < 2
.public Network getNetwork()
Network
topology may cause this class to become inconsistent.public int getSize()
public double[] getFeatures(int i)
i
in the map.i
- Neuron index.i
.OutOfRangeException
- if i
is out of range.private void createLinks()
private void readObject(java.io.ObjectInputStream in)
in
- Input stream.private java.lang.Object writeReplace()
Copyright (c) 2003-2016 Apache Software Foundation