|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.simnet.interfaces.Neuron
public abstract class Neuron
Neuron represents a node in the neural network. Most of the "logic" of the neural network occurs here, in the update function
| Field Summary | |
|---|---|
protected double |
activation
Activation value of the neuron. |
protected ArrayList |
fanIn
List of synpases this neuron attaches to. |
protected ArrayList |
fanOut
List of synapses attaching to this neuron. |
protected double |
lowerBound
Minimum value this neuron can take. |
protected double |
upperBound
Maximum value this neuron can take. |
| Constructor Summary | |
|---|---|
Neuron()
Default constructor needed for external calls which create neurons then set their parameters. |
|
Neuron(double x,
double y)
Initialize a neuron with spatial coordinates. |
|
Neuron(Neuron n)
This constructor is used when creating a neuron of one type from another neuron of another type only values. |
|
| Method Summary | |
|---|---|
void |
addActivation(double amount)
Add specified amount of activation to this neuron. |
void |
addSource(Synapse source)
Connect this neuron to source neuron via a weight. |
void |
addTarget(Synapse target)
Connect this neuron to target neuron via a weight. |
void |
checkBounds()
If activation is above or below its bounds set it to those bounds. |
void |
clear()
Set activation to 0; override for other "clearing" behavior. |
double |
clip(double value)
If value is above or below its bounds set it to those bounds. |
boolean |
connectedToWeight(Synapse w)
Check if this neuron is connected to a given weight. |
boolean |
containsString(ArrayList src,
String target)
Utility method to see if an array of names (from the world) contains a target string. |
void |
debug()
Sends relevant information about the network to standard output. |
void |
decrementActivation()
Decrement this neuron by increment. |
void |
deleteConnectedSynapses()
Delete connected synapses. |
void |
deleteFanIn()
Delete fan in. |
void |
deleteFanOut()
Delete fan out. |
abstract Neuron |
duplicate()
|
Neuron |
duplicate(Neuron n)
Creates a duplicate of this neuron; used in copy/paste. |
double |
getActivation()
|
double |
getAverageInput()
|
double |
getBuffer()
|
ArrayList |
getFanIn()
|
ArrayList |
getFanOut()
|
double |
getGaugeValue()
|
String |
getHelp()
Returns help information related to this neuron type. |
String |
getId()
|
double |
getIncrement()
|
double |
getInputValue()
|
double |
getLowerBound()
|
MotorCoupling |
getMotorCoupling()
|
static int |
getNeuronTypeIndex(String type)
Helper function for combo boxes. |
int |
getNumberOfActiveInputs(int threshold)
Returns the number of neurons attaching to this one which have activity above a specified threshold. |
Network |
getParentNetwork()
|
SensoryCoupling |
getSensoryCoupling()
|
double |
getSummedIncomingWeights()
Returns the sum of the strengths of the weights attaching to this neuron. |
abstract int |
getTimeType()
|
String |
getToolTipText()
Returns string for tool tip or short description. |
double |
getTotalInput()
|
String |
getType()
|
static String[] |
getTypeList()
|
double |
getUpperBound()
|
double |
getWeightedInputs()
Sums the weighted signals that are sent to this node. |
double |
getX()
|
double |
getY()
|
void |
incrementActivation()
Increment this neuron by increment. |
void |
initCastor()
Initializes the castor for sensory and motor couplings. |
boolean |
isInput()
Return true if this neuron has a sensory coupling attached. |
boolean |
isOutput()
Return true if this neuron has a motor coupling attached. |
void |
randomize()
Randomize this neuron to a value between upperBound and lowerBound. |
void |
randomizeBuffer()
Randomize this neuron to a value between upperBound and lowerBound. |
void |
round(int precision)
Round the activation level of this neuron off to a specified precision. |
void |
setActivation(double act)
Sets the activation of the neuron. |
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 |
setFanIn(ArrayList fanIn)
|
void |
setFanOut(ArrayList fanOut)
|
void |
setId(String theName)
Sets the id of the neuron. |
void |
setIncrement(double d)
Sets the neuron increment. |
void |
setInputValue(double inputValue)
|
void |
setLowerBound(double d)
Sets the lower bound of the neuron. |
void |
setMotorCoupling(MotorCoupling motorCoupling)
|
void |
setParentNetwork(Network network)
|
void |
setSensoryCoupling(SensoryCoupling sc)
|
static void |
setTypeList(String[] typeList)
|
void |
setUpperBound(double d)
Sets the upper bound of the neuron. |
void |
setX(double x)
|
void |
setY(double y)
|
String |
toString()
|
abstract void |
update()
Updates network with attached world. |
void |
updateConnectedOutward()
Update all neurons n this neuron is connected to, by adding current activation times the connection-weight NOT CURRENTLY USED. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double activation
protected double lowerBound
protected double upperBound
protected ArrayList fanOut
protected ArrayList fanIn
| Constructor Detail |
|---|
public Neuron()
public Neuron(double x,
double y)
x - x coordinate of new neuron.y - y coordinate of new neuron.public Neuron(Neuron n)
n - Neuron| Method Detail |
|---|
public Neuron duplicate(Neuron n)
n - Neuron to duplicate
public abstract int getTimeType()
public abstract Neuron duplicate()
public abstract void update()
public void initCastor()
public boolean containsString(ArrayList src,
String target)
src - the list of Stringstarget - the string to check for
public void setActivation(double act)
act - Activationpublic double getActivation()
public double getGaugeValue()
getGaugeValue in interface GaugeSourceGaugeSourcepublic String getId()
getId in interface GaugeSourcepublic void setId(String theName)
theName - Neuron idpublic double getUpperBound()
public void setUpperBound(double d)
d - Value to set upper boundpublic double getLowerBound()
public void setLowerBound(double d)
d - Value to set lower boundpublic double getIncrement()
public void setIncrement(double d)
d - Value to set incrementpublic ArrayList getFanIn()
public ArrayList getFanOut()
public void setFanIn(ArrayList fanIn)
fanIn - The fanIn to set.public void setFanOut(ArrayList fanOut)
fanOut - The fanOut to set.public void incrementActivation()
public void decrementActivation()
public void addTarget(Synapse target)
target - the connnection between this neuron and a target neuronpublic void addSource(Synapse source)
source - the connnection between this neuron and a source neuronpublic void addActivation(double amount)
amount - amount to add to this neuronpublic double getWeightedInputs()
public void randomize()
public void randomizeBuffer()
public void updateConnectedOutward()
public boolean connectedToWeight(Synapse w)
w - weight to check
public void round(int precision)
precision - precision to round this neuron's activaion off topublic void checkBounds()
public double clip(double value)
value - Value to check
public void debug()
public Network getParentNetwork()
public void setParentNetwork(Network network)
network - reference to the Network object this neuron is part of.public void setBuffer(double d)
d - temporary valuepublic double getBuffer()
public double getInputValue()
public void setInputValue(double inputValue)
inputValue - The inputValue to set.public String getType()
public String getHelp()
public static String[] getTypeList()
public static void setTypeList(String[] typeList)
typeList - The typeList to set.public static int getNeuronTypeIndex(String type)
type - Type of neuron to get index
public double getSummedIncomingWeights()
public int getNumberOfActiveInputs(int threshold)
threshold - value above which neurons are considered "active."
public double getAverageInput()
public double getTotalInput()
public MotorCoupling getMotorCoupling()
public void setMotorCoupling(MotorCoupling motorCoupling)
motorCoupling - The motorCoupling to set.public SensoryCoupling getSensoryCoupling()
public void setSensoryCoupling(SensoryCoupling sc)
sc - the new SensoryCoupling object.public boolean isOutput()
public boolean isInput()
public double getX()
public void setX(double x)
x - The x coordinate to set.public double getY()
public void setY(double y)
y - The y coordinate to set.public void deleteConnectedSynapses()
public void deleteFanIn()
public void deleteFanOut()
public String toString()
toString in class ObjectObjectpublic void clear()
public String getToolTipText()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||