net.openai.ai.nn.network
Class Neuron

java.lang.Object
  |
  +--net.openai.ai.nn.network.Neuron
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BiasNeuron

public class Neuron
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
Neuron()
           
 
Method Summary
 void addConnectionFrom(Connection connection)
          Add a connection from this neuron.
 void addConnectionTo(Connection connection)
          Add a connection to this neuron.
 java.util.Vector getConnections()
          Gets all connections for this neuron..
 java.util.Vector getConnectionsFrom()
          Gets all 'from' connections for this neuron..
 java.util.Vector getConnectionsTo()
          Gets all 'to' connections for this neuron..
 Connection getConnectionTo(Neuron neuron)
          Gets a connection to a particular neuron.
 double getError()
          Gets the error for this neuron.
 double getInput()
          Gets the input for this neuron.
 double getOutput()
          Gets the output for this neuron.
 boolean isErrorSet()
          Returns a flag that tells whether this neuron has had the error set
 void setError(double error)
          Sets the error for this neuron.
 void setInput(double input)
          Sets the input for this neuron.
 void setOutput(double output)
          Sets the output for this neuron.
 java.lang.String toString()
          Returns a string rpresentation of the neuron.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Neuron

public Neuron()
Method Detail

getInput

public final double getInput()
Gets the input for this neuron.
Returns:
double The input for this neuron.

setInput

public final void setInput(double input)
Sets the input for this neuron.
Parameters:
input - The input to be set for this neuron.

getOutput

public final double getOutput()
Gets the output for this neuron.
Returns:
double The output for this neuron.

setOutput

public final void setOutput(double output)
Sets the output for this neuron.
Parameters:
output - The output to be set for this neuron.

getConnectionTo

public final Connection getConnectionTo(Neuron neuron)
Gets a connection to a particular neuron.
Parameters:
neuron - The neuron which may be connected to this neuron.
Returns:
Connection to the neuron...or null if not connected.

getConnections

public final java.util.Vector getConnections()
Gets all connections for this neuron..
Returns:
Vector All connections for this neuron.

getConnectionsTo

public final java.util.Vector getConnectionsTo()
Gets all 'to' connections for this neuron..
Returns:
Vector All connections 'to' this neuron.

getConnectionsFrom

public final java.util.Vector getConnectionsFrom()
Gets all 'from' connections for this neuron..
Returns:
Vector All connections 'from' this neuron.

addConnectionFrom

public final void addConnectionFrom(Connection connection)
Add a connection from this neuron.
Parameters:
connection - The connection to add.

addConnectionTo

public final void addConnectionTo(Connection connection)
Add a connection to this neuron.
Parameters:
connection - The connection to add.

getError

public final double getError()
Gets the error for this neuron.
Returns:
double The error for this neuron.

setError

public final void setError(double error)
Sets the error for this neuron.
Parameters:
error - The error to be set for this neuron.

isErrorSet

public final boolean isErrorSet()
Returns a flag that tells whether this neuron has had the error set
Returns:
boolean - Whether this neuron has had it's error calculated.

toString

public final java.lang.String toString()
Returns a string rpresentation of the neuron.
Overrides:
toString in class java.lang.Object
Returns:
String A representation of the neuron.