org.simnet.interfaces
Class Synapse

java.lang.Object
  extended by org.simnet.interfaces.Synapse
All Implemented Interfaces:
GaugeSource
Direct Known Subclasses:
ClampedSynapse, Hebbian, HebbianThresholdSynapse, OjaSynapse, RandomSynapse, ShortTermPlasticitySynapse, SignalSynapse, SubtractiveNormalizationSynapse, TraceSynapse

public abstract class Synapse
extends Object
implements GaugeSource

Synapse objects represent "connections" between neurons, which learn (grow or weaken) based on various factors, including the activation level of connected neurons.


Field Summary
protected  String id
          Synapse id.
protected  double increment
          Amount to increment the neuron.
protected  double lowerBound
          Lower limit of synapse.
static int NUM_PARAMETERS
          Number of parameters.
protected  Neuron source
          Neuron activation will come from.
protected  SpikeResponder spikeResponder
          Only used of source neuron is a spiking neuron.
protected  double strength
          Strength of synapse.
protected  Neuron target
          Neuron to which the synapse is attached.
protected  double upperBound
          Upper limit of synapse.
 
Constructor Summary
Synapse()
          Default synapse constructor.
Synapse(Synapse s)
          This constructor is used when creating a synapse of one type from another synapse of another type Only values common to different types of synapse are copied.
 
Method Summary
 void checkBounds()
          If weight value is above or below its bounds set it to those bounds.
 double clip(double value)
          If value is above or below its bounds set it to those bounds.
 void decrementWeight()
          Decrement this weight by increment.
abstract  Synapse duplicate()
           
 Synapse duplicate(Synapse s)
          Create duplicate weights.
 int getDelay()
           
 double getGaugeValue()
           
 String getId()
           
 double getIncrement()
           
 double getLowerBound()
           
 Network getParent()
           
 Neuron getSource()
           
 SpikeResponder getSpikeResponder()
           
 double getStrength()
           
static int getSynapseTypeIndex(String type)
          Helper function for combo boxes.
 Neuron getTarget()
           
 String getType()
           
static String[] getTypeList()
           
 double getUpperBound()
           
 double getValue()
          For spiking source neurons, returns the spike-responder's value times the synapse strength For non-spiking neurons, returns the pre-synaptic activation times the synapse strength.
 void incrementWeight()
          Increment this weight by increment.
 void init()
          Initializes a new synapse.
 void initSpikeResponder()
          Set a default spike responder if the source neuron is a spiking neuron, else set the spikeResponder to null.
 void randomize()
          Randomize this weight to a value between its upper and lower bounds.
 void reinforce()
          Increase the absolute value of this weight by increment amount.
 void setDelay(int dly)
          Delay manager.
 void setId(String id)
           
 void setIncrement(double d)
          Sets the amount to increment neuron.
 void setLowerBound(double d)
          Sets the lower synapse bound.
 void setParent(Network parent)
           
 void setSource(Neuron n)
          New source neuron to attach the synapse.
 void setSpikeResponder(SpikeResponder sr)
           
 void setStrength(double wt)
          Sets the strength of the synapse.
 void setTarget(Neuron n)
          New target neuron to attach the synapse.
 void setUpperBound(double d)
          Sets the upper synapse bound.
 String toString()
           
abstract  void update()
          Update synapse.
 void weaken()
          Decrease the absolute value of this weight by increment amount.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

source

protected Neuron source
Neuron activation will come from.


target

protected Neuron target
Neuron to which the synapse is attached.


spikeResponder

protected SpikeResponder spikeResponder
Only used of source neuron is a spiking neuron.


id

protected String id
Synapse id.


NUM_PARAMETERS

public static final int NUM_PARAMETERS
Number of parameters.

See Also:
Constant Field Values

strength

protected double strength
Strength of synapse.


increment

protected double increment
Amount to increment the neuron.


upperBound

protected double upperBound
Upper limit of synapse.


lowerBound

protected double lowerBound
Lower limit of synapse.

Constructor Detail

Synapse

public Synapse()
Default synapse constructor.


Synapse

public Synapse(Synapse s)
This constructor is used when creating a synapse of one type from another synapse of another type Only values common to different types of synapse are copied.

Parameters:
s - Synapse to be created from another
Method Detail

init

public void init()
Initializes a new synapse.


initSpikeResponder

public void initSpikeResponder()
Set a default spike responder if the source neuron is a spiking neuron, else set the spikeResponder to null.


duplicate

public Synapse duplicate(Synapse s)
Create duplicate weights. Used in copy/paste.

Parameters:
s - weight to duplicate
Returns:
duplicate weight

update

public abstract void update()
Update synapse.


duplicate

public abstract Synapse duplicate()
Returns:
Duplicate synapse.

getValue

public double getValue()
For spiking source neurons, returns the spike-responder's value times the synapse strength For non-spiking neurons, returns the pre-synaptic activation times the synapse strength.

Returns:
Value

getType

public String getType()
Returns:
the name of the class of this synapse

getStrength

public double getStrength()
Returns:
Strength of synapse.

getGaugeValue

public double getGaugeValue()
Specified by:
getGaugeValue in interface GaugeSource
Returns:
Current gauge value.
See Also:
GaugeSource

getSource

public Neuron getSource()
Returns:
Source neuron to which the synapse is attached.

setSource

public void setSource(Neuron n)
New source neuron to attach the synapse.

Parameters:
n - Neuron to attach synapse

getTarget

public Neuron getTarget()
Returns:
Target neuron to which the synapse is attached.

setTarget

public void setTarget(Neuron n)
New target neuron to attach the synapse.

Parameters:
n - Neuron to attach synapse

setStrength

public void setStrength(double wt)
Sets the strength of the synapse.

Parameters:
wt - Strength value

getUpperBound

public double getUpperBound()
Returns:
Upper synapse bound.

setUpperBound

public void setUpperBound(double d)
Sets the upper synapse bound.

Parameters:
d - bound

getLowerBound

public double getLowerBound()
Returns:
Lower synapse boundy.

setLowerBound

public void setLowerBound(double d)
Sets the lower synapse bound.

Parameters:
d - bound

getIncrement

public double getIncrement()
Returns:
Amount to increment neuron.

setIncrement

public void setIncrement(double d)
Sets the amount to increment neuron.

Parameters:
d - Increment amount

incrementWeight

public void incrementWeight()
Increment this weight by increment.


decrementWeight

public void decrementWeight()
Decrement this weight by increment.


reinforce

public void reinforce()
Increase the absolute value of this weight by increment amount.


weaken

public void weaken()
Decrease the absolute value of this weight by increment amount.


randomize

public void randomize()
Randomize this weight to a value between its upper and lower bounds.


checkBounds

public void checkBounds()
If weight value is above or below its bounds set it to those bounds.


clip

public double clip(double value)
If value is above or below its bounds set it to those bounds.

Parameters:
value - Value to be checked
Returns:
Evaluated value

getId

public String getId()
Specified by:
getId in interface GaugeSource
Returns:
Returns the id.

setId

public void setId(String id)
Parameters:
id - The id to set.

getSynapseTypeIndex

public static int getSynapseTypeIndex(String type)
Helper function for combo boxes. Associates strings with indices.

Parameters:
type - Synapse type
Returns:
Index

getTypeList

public static String[] getTypeList()
Returns:
Returns the typeList.

getSpikeResponder

public SpikeResponder getSpikeResponder()
Returns:
Returns the spikeResponder.

setSpikeResponder

public void setSpikeResponder(SpikeResponder sr)
Parameters:
sr - The spikeResponder to set.

setDelay

public void setDelay(int dly)
Delay manager.

Parameters:
dly - Amound of delay

getDelay

public int getDelay()
Returns:
Current amount of delay.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object

getParent

public Network getParent()
Returns:
Returns the parent.

setParent

public void setParent(Network parent)
Parameters:
parent - The parent to set.