public class Neuron
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static NeuronUpdateRule |
DEFAULT_UPDATE_RULE
The default neuron update rule.
|
static int |
PRE_ALLOCATED_NUM_SYNAPSES
Pre-allocates the number of bins in this neuron's fanIn/Out for
efficiency.
|
Constructor and Description |
---|
Neuron(Network parent)
Construct a neuron with all default values in the specified network.
|
Neuron(Network parent,
Neuron n)
Copy constructor.
|
Neuron(Network parent,
NeuronUpdateRule updateRule)
Construct a specific type of neuron.
|
Neuron(Network parent,
java.lang.String updateRule)
Construct a specific type of neuron from a string description.
|
Modifier and Type | Method and Description |
---|---|
void |
addAfferent(Synapse source)
Adds an afferent synapse to this neuron, i.e.
|
void |
addEfferent(Synapse synapse)
Adds an efferent synapse to this neuron, i.e.
|
void |
clear()
Forward to updaterule's clearing method.
|
void |
debug()
Sends relevant information about the network to standard output.
|
Neuron |
deepCopy()
Provides a deep copy of this neuron.
|
void |
deleteConnectedSynapses()
Delete connected synapses and remove them from the network and any other
structures.
|
void |
deleteFanIn()
Removes all synapses from fanIn and from the network or any intermediate
structures.
|
void |
deleteFanOut()
Removes all synapses from fanOut and from the network or any intermediate
structures.
|
void |
forceSetActivation(double act)
Sets the activation of the neuron regardless of the state of the neuron.
|
double |
getActivation() |
double |
getAuxValue() |
double |
getAverageInput() |
double |
getBuffer() |
java.util.List<Synapse> |
getFanIn() |
java.util.List<Synapse> |
getFanInList()
Used for deletion to avoid a ConcurrentModificationException as well as
conform to the other processes inovlved in removing synapses from a
network.
|
java.util.Map<Neuron,Synapse> |
getFanOut() |
java.util.List<Synapse> |
getFanOutList()
Used for deletion to avoid a ConcurrentModificationException as well as
conform to the other processes inovlved in removing synapses from a
network.
|
java.lang.String |
getId() |
double |
getInputValue() |
java.lang.String |
getLabel() |
double |
getLowerBound()
Return the lower bound for the the underlying rule, if it is bounded.
|
Network |
getNetwork()
Returns the root network this neuron is embedded in.
|
int |
getNumberOfActiveInputs(int threshold)
Returns the number of neurons attaching to this one which have activity
above a specified threshold.
|
Group |
getParentGroup()
TODO: Possibly make this be a NeuronGroup.
|
SimbrainConstants.Polarity |
getPolarity()
Polarity of this neuron (excitatory, inhibitory, or none = null).
|
java.awt.geom.Point2D |
getPosition()
Returns position as a 2-d point.
|
static java.util.List<NeuronUpdateRule> |
getRuleList(java.util.List<Neuron> neuronList)
A method that returns a list of all the neuron update rules associated
with a list of neurons.
|
boolean |
getSpkBuffer() |
double |
getSummedIncomingWeights()
Returns the sum of the strengths of the weights attaching to this neuron.
|
double |
getSynapticInput()
Sums the weighted synaptic inputs to a given neuron based on that
synapse's spike responder.
|
double |
getTargetValue() |
Network.TimeType |
getTimeType()
Returns the time type of this neuron's update rule.
|
java.lang.String |
getToolTipText()
Forward to update rule's tool tip method, which returns string for tool
tip or short description.
|
double |
getTotalInput() |
java.lang.String |
getType()
The name of the update rule of this neuron; it's "type".
|
int |
getUpdatePriority() |
NeuronUpdateRule |
getUpdateRule()
Returns the current update rule.
|
java.lang.String |
getUpdateRuleDescription()
Returns the current update rule's description (name).
|
double |
getUpperBound()
Return the upper bound for the the underlying rule, if it is bounded.
|
double |
getWeightedInputs()
Sums the weighted signals that are sent to this node.
|
double |
getX() |
double |
getY() |
double |
getZ() |
boolean |
isClamped() |
boolean |
isConnected(Synapse s)
True if the synapse is connected to this neuron, false otherwise.
|
boolean |
isGenerator() |
boolean |
isPolarized()
If the neuron is polarized, it will be excitatory or inhibitory.
|
boolean |
isSpike() |
void |
normalizeExcitatoryFanIn()
Normalizes the excitatory synaptic strengths impinging on this neuron,
that is finds the sum of the exctiatory weights and divides each weight
value by that sum;
|
void |
normalizeFanIn() |
void |
normalizeInhibitoryFanIn() |
void |
offset(double delta_x,
double delta_y)
Translate the neuron by a specified amount.
|
void |
postUnmarshallingInit()
Perform any initialization required when creating a neuron, but after the
parent network has been added.
|
void |
randomize()
Randomize this neuron to a value between upperBound and lowerBound.
|
void |
randomizeBias(double lower,
double upper)
If this neuron has a bias field, randomize it within the specified
bounds.
|
void |
randomizeBuffer()
Randomize this neuron to a value between upperBound and lowerBound.
|
void |
randomizeFanIn()
Randomize all synapses that attach to this neuron.
|
void |
randomizeFanOut()
Randomize all synapses that attach to this neuron.
|
void |
removeAfferent(Synapse synapse)
Remove this neuron from source neuron via a weight.
|
void |
removeEfferent(Synapse synapse)
Remove this neuron from target neuron via a weight.
|
void |
setActivation(double act)
Sets the activation of the neuron if it is not clamped.
|
void |
setAuxValue(double auxValue) |
void |
setBuffer(double d)
Temporary buffer which can be used for algorithms which should not depend
on the order in which neurons are updated.
|
void |
setClamped(boolean clamped)
Toggles whether this neuron is clamped.
|
void |
setGenerator(boolean generator)
Mark this neuron as an input generator.
|
void |
setId(java.lang.String theName)
Sets the id of the neuron.
|
void |
setIncrement(double increment)
Convenience method to set increment on the neuron's update rule.
|
void |
setInputValue(double inputValue)
Set the input value of the neuron.
|
void |
setLabel(java.lang.String label) |
void |
setLocation(double x,
double y)
Set x, y position of a neuron.
|
void |
setLowerBound(double lowerBound)
Convenience method to set lower bound on the neuron's update rule, if it
is a bounded update rule.
|
void |
setParentGroup(Group parentGroup) |
void |
setPolarity(SimbrainConstants.Polarity polarity) |
void |
setPosition(java.awt.geom.Point2D position)
Set position of neuron using a point object.
|
void |
setSpike(boolean spike) |
void |
setSpkBuffer(boolean spkBuffer) |
void |
setTargetValue(double targetValue)
Set target value.
|
void |
setToBufferVals()
A general purpose method that moves all relevant values from this
neuron's buffer to its main values.
|
void |
setUpdatePriority(int updatePriority) |
void |
setUpdateRule(NeuronUpdateRule updateRule)
Set a new update rule.
|
void |
setUpdateRule(java.lang.String name)
Sets the update rule using a String description.
|
void |
setUpperBound(double upperBound)
Convenience method to set upper bound on the neuron's update rule, if it
is a bounded update rule.
|
void |
setX(double x) |
void |
setY(double y) |
void |
setZ(double z) |
java.lang.String |
toString() |
void |
update()
Updates neuron.
|
void |
updateFanIn()
A helper method which iterates over each afferent synapse to this neuron
and calls their update functions.
|
public static final NeuronUpdateRule DEFAULT_UPDATE_RULE
public static final int PRE_ALLOCATED_NUM_SYNAPSES
public Neuron(Network parent)
parent
- The parent network of this neuron.public Neuron(Network parent, java.lang.String updateRule)
parent
- The parent network. Be careful not to set this to root network
if the root network is not the parent.updateRule
- the update methodpublic Neuron(Network parent, NeuronUpdateRule updateRule)
parent
- The parent network. Be careful not to set this to root network
if the root network is not the parent.updateRule
- the update methodpublic Neuron deepCopy()
public void postUnmarshallingInit()
public Network.TimeType getTimeType()
public NeuronUpdateRule getUpdateRule()
public java.lang.String getUpdateRuleDescription()
public void setUpdateRule(java.lang.String name)
name
- the "simple name" of the class associated with the neuron rule
to set.public void setUpdateRule(NeuronUpdateRule updateRule)
updateRule
- the neuronUpdateRule to setpublic void update()
public void setActivation(double act)
forceSetActivation(double)
. Under normal circumstances model classes
will use this method.act
- Activationpublic void setToBufferVals()
public void forceSetActivation(double act)
act
- the new activation valuepublic double getActivation()
public java.lang.String getId()
public void setId(java.lang.String theName)
theName
- Neuron idpublic java.util.List<Synapse> getFanIn()
public java.util.Map<Neuron,Synapse> getFanOut()
public void addEfferent(Synapse synapse)
fanOut
. Does NOT add this synapse to the network or any
intermediate bodies. If the connection is a duplicate connection the
original synapse connecting this neuron to a target neuron will be
removed and replaced by Synapse s.synapse
- the synapse for which this neuron is a source to add.public void removeEfferent(Synapse synapse)
synapse
- the connection between this neuron and a target neuronpublic void addAfferent(Synapse source)
fanIn
. Does NOT add this synapse to the network or any
intermediate bodies.source
- adds source as a synapse for which this neuron is the
target.public void removeAfferent(Synapse synapse)
synapse
- the connection between this neuron and a source neuronpublic double getWeightedInputs()
public double getSynapticInput()
public void updateFanIn()
public void normalizeExcitatoryFanIn()
public void normalizeInhibitoryFanIn()
public void normalizeFanIn()
public void randomize()
public void randomizeBuffer()
public void debug()
public Network getNetwork()
public void setBuffer(double d)
d
- temporary valuepublic double getBuffer()
public double getInputValue()
public void setInputValue(double inputValue)
getWeightedInputs()
as an "external input" to the neuron. When
external components (like input tables) send activation to the network
they should use this.inputValue
- The inputValue to set.public java.lang.String getType()
public double getSummedIncomingWeights()
public int getNumberOfActiveInputs(int threshold)
threshold
- value above which neurons are considered "active."public double getAverageInput()
public double getTotalInput()
public boolean isConnected(Synapse s)
s
- the synapse to check.public double getX()
public double getY()
public double getZ()
public void setX(double x)
x
- The x coordinate to set.public void setY(double y)
y
- The y coordinate to set.public void setZ(double z)
z
- The z coordinate to set.public void setLocation(double x, double y)
x
- x coordinate for neurony
- y coordinate for neuronpublic void offset(double delta_x, double delta_y)
delta_x
- x amount to translate neurondelta_y
- y amount to translate neuronpublic void deleteConnectedSynapses()
public java.util.List<Synapse> getFanInList()
public java.util.List<Synapse> getFanOutList()
public void deleteFanOut()
public void deleteFanIn()
public java.lang.String toString()
toString
in class java.lang.Object
public void clear()
public java.lang.String getToolTipText()
public double getTargetValue()
public void setTargetValue(double targetValue)
targetValue
- value to set.public int getUpdatePriority()
public void setUpdatePriority(int updatePriority)
updatePriority
- to set.public boolean isClamped()
public void setClamped(boolean clamped)
clamped
- Whether this neuron is to be clamped.public java.lang.String getLabel()
public void setLabel(java.lang.String label)
label
- the label to setpublic java.awt.geom.Point2D getPosition()
public void setPosition(java.awt.geom.Point2D position)
position
- point location of neuronpublic void randomizeBias(double lower, double upper)
lower
- lower bound for randomization.upper
- upper bound for randomization.public void randomizeFanIn()
public void randomizeFanOut()
public static java.util.List<NeuronUpdateRule> getRuleList(java.util.List<Neuron> neuronList)
neuronList
- The list of neurons whose update rules we want to query.public Group getParentGroup()
public void setParentGroup(Group parentGroup)
parentGroup
- the parentGroup to setpublic boolean isGenerator()
public void setGenerator(boolean generator)
fan-in list
to null if true.generator
- Whether or not this is being set as an input generator.public void setUpperBound(double upperBound)
upperBound
- upper bound to set.public void setLowerBound(double lowerBound)
lowerBound
- lower bound to set.public double getUpperBound()
public double getLowerBound()
public void setIncrement(double increment)
increment
- increment to setpublic double getAuxValue()
public void setAuxValue(double auxValue)
auxValue
- the auxValue to setpublic boolean isPolarized()
public SimbrainConstants.Polarity getPolarity()
public void setPolarity(SimbrainConstants.Polarity polarity)
public boolean isSpike()
public void setSpike(boolean spike)
public boolean getSpkBuffer()
public void setSpkBuffer(boolean spkBuffer)