public class InputLayer extends java.lang.Object implements ILayer<InputNeuron>
Input layer of a neural net
Modifier and Type | Field and Description |
---|---|
protected int |
maxnofneurons
Maximum number of neurons
|
protected java.util.ArrayList<InputNeuron> |
neurons
Array of neurons of the layer
|
protected static <any> |
XML
Marshal/Unmarshal maximum number of neurons and each neuron
|
Constructor and Description |
---|
InputLayer()
Empty constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addNeuron(InputNeuron neuron)
Add a neuron to the layer
|
InputLayer |
copy()
Returns a copy of this input layer
|
boolean |
equals(ILayer<InputNeuron> other)
Checks if this layer is equal to another
|
int |
getMaxnofneurons()
Returns the maximum number of neurons of this layer
|
InputNeuron |
getNeuron(int index)
Returns a neuron of the layer using its index
|
int |
getNofneurons()
Returns the number of neurons of this layer
|
int |
hashCode()
Returns an integer number that identifies the layer
|
int |
indexOf(InputNeuron neuron)
Returns the index of a neuron in the layer
|
void |
setMaxnofneurons(int maxnofneurons)
Sets the maximum number of neurons of this layer
|
protected static final <any> XML
Marshal/Unmarshal maximum number of neurons and each neuron
protected int maxnofneurons
protected java.util.ArrayList<InputNeuron> neurons
public int getMaxnofneurons()
Returns the maximum number of neurons of this layer
getMaxnofneurons
in interface ILayer<InputNeuron>
public void setMaxnofneurons(int maxnofneurons)
Sets the maximum number of neurons of this layer
maxnofneurons
- Number of neuronspublic void addNeuron(InputNeuron neuron)
Add a neuron to the layer
addNeuron
in interface ILayer<InputNeuron>
neuron
- New neuron to add to the layerpublic InputNeuron getNeuron(int index)
Returns a neuron of the layer using its index
getNeuron
in interface ILayer<InputNeuron>
index
- Index of the neuronpublic int getNofneurons()
Returns the number of neurons of this layer
getNofneurons
in interface ILayer<InputNeuron>
public int indexOf(InputNeuron neuron)
Returns the index of a neuron in the layer
neuron
- Neuron in the layerpublic boolean equals(ILayer<InputNeuron> other)
Checks if this layer is equal to another
equals
in interface ILayer<InputNeuron>
other
- Other layer to comparepublic int hashCode()
Returns an integer number that identifies the layer
hashCode
in interface ILayer<InputNeuron>
hashCode
in class java.lang.Object
public InputLayer copy()
Returns a copy of this input layer