org.encog.neural.networks.synapse
Class BasicSynapse

java.lang.Object
  extended by org.encog.persist.BasicPersistedSubObject
      extended by org.encog.neural.networks.synapse.BasicSynapse
All Implemented Interfaces:
Serializable, Synapse, EncogPersistedObject
Direct Known Subclasses:
DirectSynapse, OneToOneSynapse, WeightedSynapse, WeightlessSynapse

public abstract class BasicSynapse
extends BasicPersistedSubObject
implements Synapse

An abstract class that implements basic functionality that may be needed by the other synapse classes. Specifically this class handles processing the from and to layer, as well as providing a name and description for the EncogPersistedObject.

Author:
jheaton
See Also:
Serialized Form

Constructor Summary
BasicSynapse()
           
 
Method Summary
abstract  Object clone()
           
 Layer getFromLayer()
           
 int getFromNeuronCount()
           
 Layer getToLayer()
           
 int getToNeuronCount()
           
 boolean isSelfConnected()
           
 void setFromLayer(Layer fromLayer)
          Set the from layer for this synapse.
 void setName(String n)
          The EncogPersistedObject requires a name and description, however, these are not used on synapses.
 void setToLayer(Layer toLayer)
          Set the target layer from this synapse.
 String toString()
          
 
Methods inherited from class org.encog.persist.BasicPersistedSubObject
getCollection, getDescription, getName, setCollection, setDescription
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.encog.neural.networks.synapse.Synapse
compute, getMatrix, getMatrixSize, getType, isTeachable, setMatrix
 
Methods inherited from interface org.encog.persist.EncogPersistedObject
createPersistor, getCollection, getDescription, getName, setCollection, setDescription
 

Constructor Detail

BasicSynapse

public BasicSynapse()
Method Detail

clone

public abstract Object clone()
Specified by:
clone in interface Synapse
Overrides:
clone in class Object
Returns:
A clone of this object.

getFromLayer

public Layer getFromLayer()
Specified by:
getFromLayer in interface Synapse
Returns:
The from layer.

getFromNeuronCount

public int getFromNeuronCount()
Specified by:
getFromNeuronCount in interface Synapse
Returns:
The neuron count from the "from layer".

getToLayer

public Layer getToLayer()
Specified by:
getToLayer in interface Synapse
Returns:
The "to layer".

getToNeuronCount

public int getToNeuronCount()
Specified by:
getToNeuronCount in interface Synapse
Returns:
The neuron count from the "to layer".

isSelfConnected

public boolean isSelfConnected()
Specified by:
isSelfConnected in interface Synapse
Returns:
True if this is a self-connected synapse. That is, the from and to layers are the same.

setFromLayer

public void setFromLayer(Layer fromLayer)
Set the from layer for this synapse.

Specified by:
setFromLayer in interface Synapse
Parameters:
fromLayer - The from layer for this synapse.

setName

public void setName(String n)
The EncogPersistedObject requires a name and description, however, these are not used on synapses.

Specified by:
setName in interface EncogPersistedObject
Overrides:
setName in class BasicPersistedSubObject
Parameters:
n - Not used.

setToLayer

public void setToLayer(Layer toLayer)
Set the target layer from this synapse.

Specified by:
setToLayer in interface Synapse
Parameters:
toLayer - The target layer from this synapse.

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2011. All Rights Reserved.