org.neuroph.core
Class Connection

java.lang.Object
  extended by org.neuroph.core.Connection
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
DelayedConnection

public class Connection
extends Object
implements Serializable

Weighted connection to another neuron.

Author:
Zoran Sevarac
See Also:
Weight, Neuron, Serialized Form

Field Summary
protected  Neuron fromNeuron
          From neuron for this connection (source neuron).
protected  Neuron toNeuron
          To neuron for this connection (target, destination neuron) This connection is input connection for to neuron.
protected  Weight weight
          Weight for this connection
 
Constructor Summary
Connection(Neuron fromNeuron, Neuron toNeuron)
          Creates a new connection between specified neurons with random weight
Connection(Neuron fromNeuron, Neuron toNeuron, double weightVal)
          Creates a new connection to specified neuron with specified weight value
Connection(Neuron fromNeuron, Neuron toNeuron, Weight weight)
          Creates a new connection to specified neuron with specified weight object
 
Method Summary
 Neuron getFromNeuron()
          Gets from neuron for this connection
 double getInput()
          Returns input received through this connection - the activation that comes from the output of the cell on the other end of connection
 Neuron getToNeuron()
          Gets to neuron for this connection
 Weight getWeight()
          Returns weight for this connection
 double getWeightedInput()
          Returns the weighted input received through this connection
 void setFromNeuron(Neuron fromNeuron)
          Sets from neuron for this connection
 void setToNeuron(Neuron toNeuron)
          Sets to neuron for this connection
 void setWeight(Weight weight)
          Set the weight of the connection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fromNeuron

protected Neuron fromNeuron
From neuron for this connection (source neuron). This connection is output connection for from neuron.


toNeuron

protected Neuron toNeuron
To neuron for this connection (target, destination neuron) This connection is input connection for to neuron.


weight

protected Weight weight
Weight for this connection

Constructor Detail

Connection

public Connection(Neuron fromNeuron,
                  Neuron toNeuron)
Creates a new connection between specified neurons with random weight

Parameters:
fromNeuron - neuron to connect from
toNeuron - neuron to connect to

Connection

public Connection(Neuron fromNeuron,
                  Neuron toNeuron,
                  Weight weight)
Creates a new connection to specified neuron with specified weight object

Parameters:
fromNeuron - neuron to connect from
toNeuron - neuron to connect to
weight - weight for this connection

Connection

public Connection(Neuron fromNeuron,
                  Neuron toNeuron,
                  double weightVal)
Creates a new connection to specified neuron with specified weight value

Parameters:
fromNeuron - neuron to connect from
toNeuron - neuron to connect to
weightVal - weight value for this connection
Method Detail

getWeight

public Weight getWeight()
Returns weight for this connection

Returns:
weight for this connection

setWeight

public void setWeight(Weight weight)
Set the weight of the connection.

Parameters:
weight - The new weight of the connection.

getInput

public double getInput()
Returns input received through this connection - the activation that comes from the output of the cell on the other end of connection

Returns:
input received through this connection

getWeightedInput

public double getWeightedInput()
Returns the weighted input received through this connection

Returns:
weighted input received through this connection

getFromNeuron

public Neuron getFromNeuron()
Gets from neuron for this connection

Returns:
from neuron for this connection

setFromNeuron

public void setFromNeuron(Neuron fromNeuron)
Sets from neuron for this connection

Parameters:
fromNeuron - neuron to set as from neuron

getToNeuron

public Neuron getToNeuron()
Gets to neuron for this connection

Returns:
neuron to set as to neuron

setToNeuron

public void setToNeuron(Neuron toNeuron)
Sets to neuron for this connection

Parameters:
toNeuron -


Copyright © 2012. All Rights Reserved.