neuroidnet.ntr
Class Area

java.lang.Object
  |
  +--neuroidnet.ntr.Area
All Implemented Interfaces:
AreaInt, Expressive, Remote, Runnable, Serializable, Simulation
Direct Known Subclasses:
Area, ConceptArea, SensoryArea

public class Area
extends Object
implements Runnable, AreaInt, Serializable, Expressive, Simulation

Entity Area that holds neurons and keeps track of time.

Since:
1.0
Version:
1.0
Author:
Cengiz Gunay
See Also:
Serialized Form

Field Summary
(package private)  double activationThreshold
          The threshold to change a Neuroid from AM to AM1 mode.
protected  Hashtable axons
          Hash table holding the white matter, e.g.
(package private)  int conceptCount
          Count of concept allocations made (via call to addArbitrarySynapses) in this Area.
 double deltaT
          Increment of time for algorithms.
(package private)  Synapse fromInhibitorySynapseTemplate
          The template used for creating synapses from the inhibitoryInterNeuroid
 int id
          Id tag of the area.
(package private)  boolean inhibInter
          True if the area contains a inhibitory inter-neuroid.
(package private)  Neuroid inhibitoryInterNeuroid
          The global inhibitory neuroid that gets input from all and projects to all in the area.
(package private)  AxonArbor inhibitorySynapseVector
          The axon emanating from the inhibitoryInterNeuroid
(package private)  Object isCalculating
          Lock variable showing the thread is busy doing the calculations.
(package private)  Object isWaiting
          Lock variable showing the thread is waiting for a step request.
(package private)  String name
          Name of the Area for identification purposes.
 Network network
          Pointer to parent network TODO: Fix access modifier from public, problem with SensoryNeuroid
 Vector neuroids
          List of Neuroids contained in Area.
protected  int numberOfNeuroids
          Number of Neuroids contained in Area.
(package private)  double period
          Oscillation period of Neuroids.
(package private)  int replication
          The replication factor, i.e.
(package private)  boolean stepRequested
          Flag showing incoming requets to step().
(package private)  Thread thread
          Thread to do the actual calculations.
 double time
          Time of the area.
 double timeConstantM
          Membrane time constant of all neurons in this area.
(package private)  Synapse toInhibitorySynapseTemplate
          The template used for creating synapses to the inhibitoryInterNeuroid
 
Constructor Summary
Area(Network network, String name, int numberOfNeuroids, int replication, double period, double threshold, boolean inhibInter, double timeConstantM, double refractoryTimeConstant, Class neuroidClass)
          Constructor with option to add inhibitory inter-neuron.
Area(Network network, String name, int numberOfNeuroids, int replication, double period, double threshold, double timeConstantM, double refractoryTimeConstant, Class neuroidClass)
          Constructor for plain Area (no inhibitory interneuron).
 
Method Summary
 void addArbitrarySynapses(Synapse destSynapseTemplate, Neuroid srcNeuroid, int numberOfSynapses)
          Hack to arbitrarily choose different neurons for each allocation of concepts.
 void addAxon(Neuroid srcNeuroid, AxonArbor synapses)
          Adds the synapses to the outgoing synapse record of the Area.
 int addNeuroid(Neuroid neuroid)
          Adds a neuroid to the Area.
 void addRandomSynapses(Synapse destSynapseTemplate, Neuroid srcNeuroid, int numberOfSynapses)
          Creates new numberOfSynapses Synapses for a given srcNeuroid to a specified destination destArea.
 void connectToArea(AreaInt destArea, double timeConstantS, double delay, double nuBoost)
          Makes connections between this Area and the given destArea.
(package private)  void fireNeuroid(Neuroid neuroid)
          Fires neuroid.
 double getActivationThreshold()
          Get the value of activationThreshold.
 Hashtable getAxons()
          Get the value of axons.
 String getName()
          Get the value of name.
 int getNumberOfNeuroids()
          Get the value of numberOfNeuroids.
 String getProperties()
          Describe Area in more detail, including static properties.
 Neuroid getRandomNeuroid()
          Returns a Neuroid which is a random member of the destArea.
 int getReplication()
          Get the value of replication.
 String getStatus()
          Mentions the time in addition to toString() contents.
 Thread getThread()
          Get the value of thread.
 void init()
          Does nothing.
private  void readObject(ObjectInputStream in)
          Method called when a serialized object is loaded.
 void receiveSpike(Synapse synapse)
          Public method to receive spikes from other areas.
 void run()
          Check if step()ing requested, and serve the request.
 void setActivationThreshold(double v)
          Set the value of activationThreshold.
 void setAxons(Hashtable v)
          Set the value of axons.
 void setName(String v)
          Set the value of name.
 void setNumberOfNeuroids(int v)
          Set the value of numberOfNeuroids.
 void setReplication(int v)
          Set the value of replication.
 void setThread(Thread v)
          Set the value of thread.
 void step()
          Updates the state of the Area.
 void stop()
          Terminates the thread dedicated to this area.
 String toString()
          Identifies are with its name.
(package private)  void updateTime()
          Just increments the time by deltaT.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

String name
Name of the Area for identification purposes.


time

public double time
Time of the area.


deltaT

public double deltaT
Increment of time for algorithms. Proxy for deltaT in network.

See Also:
Network.deltaT

id

public int id
Id tag of the area.


numberOfNeuroids

protected int numberOfNeuroids
Number of Neuroids contained in Area. TODO: should be obsolete, redundant info with size of neuroids vector.

See Also:
neuroids, Neuroid

replication

int replication
The replication factor, i.e. the number of Neuroids allocated for each concept.


period

double period
Oscillation period of Neuroids.

See Also:
Neuroid

neuroids

public Vector neuroids
List of Neuroids contained in Area. TODO: Fix access modifier from public, becuase of peripherals..

See Also:
Neuroid

inhibitoryInterNeuroid

Neuroid inhibitoryInterNeuroid
The global inhibitory neuroid that gets input from all and projects to all in the area.


fromInhibitorySynapseTemplate

Synapse fromInhibitorySynapseTemplate
The template used for creating synapses from the inhibitoryInterNeuroid

See Also:
inhibitoryInterNeuroid

toInhibitorySynapseTemplate

Synapse toInhibitorySynapseTemplate
The template used for creating synapses to the inhibitoryInterNeuroid

See Also:
inhibitoryInterNeuroid

inhibitorySynapseVector

AxonArbor inhibitorySynapseVector
The axon emanating from the inhibitoryInterNeuroid

See Also:
init()

axons

protected Hashtable axons
Hash table holding the white matter, e.g. the axons of neuroids residing in this Area connecting to Synapses of other Neuroids. Returns a Vector of Synapses for every Neuroid key.

See Also:
Synapse, Neuroid

isCalculating

transient volatile Object isCalculating
Lock variable showing the thread is busy doing the calculations.

See Also:
stepRequested, run(), step()

isWaiting

transient volatile Object isWaiting
Lock variable showing the thread is waiting for a step request.

See Also:
stepRequested, run(), step()

stepRequested

volatile boolean stepRequested
Flag showing incoming requets to step().

See Also:
run(), step()

thread

transient Thread thread
Thread to do the actual calculations. Is not part of the persistent object.


conceptCount

int conceptCount
Count of concept allocations made (via call to addArbitrarySynapses) in this Area.

See Also:
addArbitrarySynapses(neuroidnet.ntr.Synapse, neuroidnet.ntr.Neuroid, int), Peripheral.Concept

network

public Network network
Pointer to parent network TODO: Fix access modifier from public, problem with SensoryNeuroid


inhibInter

boolean inhibInter
True if the area contains a inhibitory inter-neuroid.


timeConstantM

public double timeConstantM
Membrane time constant of all neurons in this area.


activationThreshold

double activationThreshold
The threshold to change a Neuroid from AM to AM1 mode.

See Also:
Neuroid.step()
Constructor Detail

Area

public Area(Network network,
            String name,
            int numberOfNeuroids,
            int replication,
            double period,
            double threshold,
            double timeConstantM,
            double refractoryTimeConstant,
            Class neuroidClass)
Constructor for plain Area (no inhibitory interneuron). Calls other constructor.

Parameters:
network - a Network value
name - a String value
numberOfNeuroids - an int value
replication - an int value
period - a double value
threshold - a double value
See Also:
#Area(Network,String,int,int,double,double,boolean,double,double)

Area

public Area(Network network,
            String name,
            int numberOfNeuroids,
            int replication,
            double period,
            double threshold,
            boolean inhibInter,
            double timeConstantM,
            double refractoryTimeConstant,
            Class neuroidClass)
Constructor with option to add inhibitory inter-neuron. Creates a new Area instance with numberOfNeuroids of Neuroids.

TODO: If a allocate-on-demand approach is used for Neuroids none should be allocated at this time.

TODO: Automatically add areas to network?

Parameters:
network - a Network value
name - a String value
numberOfNeuroids - an int value
replication - an int value
period - a double value
threshold - a double value
inhibInter - a boolean value
See Also:
Neuroid
Method Detail

getName

public String getName()
Get the value of name.

Returns:
value of name.

setName

public void setName(String v)
Set the value of name.

Parameters:
v - Value to assign to name.

getNumberOfNeuroids

public int getNumberOfNeuroids()
Get the value of numberOfNeuroids.

Specified by:
getNumberOfNeuroids in interface AreaInt
Returns:
value of numberOfNeuroids.

setNumberOfNeuroids

public void setNumberOfNeuroids(int v)
Set the value of numberOfNeuroids.

Parameters:
v - Value to assign to numberOfNeuroids.

getReplication

public int getReplication()
Get the value of replication.

Specified by:
getReplication in interface AreaInt
Returns:
value of replication.

setReplication

public void setReplication(int v)
Set the value of replication.

Parameters:
v - Value to assign to replication.

getAxons

public Hashtable getAxons()
Get the value of axons.

Returns:
value of axons.

setAxons

public void setAxons(Hashtable v)
Set the value of axons.

Parameters:
v - Value to assign to axons.

getThread

public Thread getThread()
Get the value of thread.

Returns:
value of thread.

setThread

public void setThread(Thread v)
Set the value of thread.

Parameters:
v - Value to assign to thread.

getActivationThreshold

public double getActivationThreshold()
Get the value of activationThreshold.

Returns:
value of activationThreshold.

setActivationThreshold

public void setActivationThreshold(double v)
Set the value of activationThreshold.

Parameters:
v - Value to assign to activationThreshold.

addNeuroid

public int addNeuroid(Neuroid neuroid)
Adds a neuroid to the Area. Determines a sequence number according to the neuroid's order in the Vector neuroids. if specified in the constructor, a simple lateral circuit is formed. A link from this neuroid to the globally inhibitory neuroid is made.

Parameters:
neuroid - a Neuroid value to add into this Area
Returns:
the id of the neuroid (i.e. index in neuroids)
See Also:
Neuroid.id

connectToArea

public void connectToArea(AreaInt destArea,
                          double timeConstantS,
                          double delay,
                          double nuBoost)
Makes connections between this Area and the given destArea. Uses modified connection probability of random multipartite graphs to determine number of Neuroids to be connected on destination Area.

Specified by:
connectToArea in interface AreaInt
Parameters:
destArea - the Area to which this one is connected.
timeConstantS - time constant to be used in creating synapses
delay - synaptic delay
nuBoost - a double factor to multiply the original probability ratio as to magnify
See Also:
Neuroid, Synapse

addAxon

public void addAxon(Neuroid srcNeuroid,
                    AxonArbor synapses)
Adds the synapses to the outgoing synapse record of the Area. If synapses associated with srcNeuroid exist, new synapses are just added to them. TO DO: get a remote reference to an AxonArbor in the remote Area and put it in hash.

Parameters:
srcNeuroid - the presynaptic Neuroid in this Area.
synapses - the Vector to be associated with srcNeuroid

addRandomSynapses

public void addRandomSynapses(Synapse destSynapseTemplate,
                              Neuroid srcNeuroid,
                              int numberOfSynapses)
Creates new numberOfSynapses Synapses for a given srcNeuroid to a specified destination destArea. AxonArbor makes sure to return a set of synapses to distinct neurons (no repetitions!)

TODO: maybe put this method back into Area? addRandomSynapse should automatically add the synapse?

Specified by:
addRandomSynapses in interface AreaInt
Parameters:
destSynapseTemplate - a Synapse value
srcNeuroid - a Neuroid value
numberOfSynapses - an int value

addArbitrarySynapses

public void addArbitrarySynapses(Synapse destSynapseTemplate,
                                 Neuroid srcNeuroid,
                                 int numberOfSynapses)
Hack to arbitrarily choose different neurons for each allocation of concepts. A variable conceptCount is used to interleave the allocated neurons. Return a Vector of new numberOfSynapses Synapses. AxonArbor makes sure to return a set of synapses to distinct neurons (no repetitions!) Used from SensoryNeuroid.

Specified by:
addArbitrarySynapses in interface AreaInt
Parameters:
destSynapseTemplate - a Synapse value
srcNeuroid - a Neuroid value
numberOfSynapses - an int value
See Also:
conceptCount, periphery.SensoryNeuroid#SensoryNeuroid

getRandomNeuroid

public Neuroid getRandomNeuroid()
Returns a Neuroid which is a random member of the destArea.

TODO: one might might pseudo-random (organized) behavior in selecting destinations (like addArbitrarySynapses).

TODO: If a allocate-on-demand approach is used for neuroids, in case of finding a non-existing neuroid should result in its creation.

Returns:
a Neuroid value
See Also:
addArbitrarySynapses(neuroidnet.ntr.Synapse, neuroidnet.ntr.Neuroid, int), AxonArbor.destArea

receiveSpike

public void receiveSpike(Synapse synapse)
Public method to receive spikes from other areas. TO DO: get an AxonArbor and process synapses in the local area. OBSOLETE: redundant, instead use Synapse.receiveSpike() directly.

Parameters:
synapse - Synapse to spike.
See Also:
Synapse

updateTime

void updateTime()
Just increments the time by deltaT. Initial idea was to read current time from hardware clock. TODO: extend this class for the parallel version. (should we?)


init

public void init()
Does nothing. TODO: should do something.

Specified by:
init in interface Simulation

step

public void step()
Updates the state of the Area. Updates all Neuroids contained within. This method returns immediately, the thread does the calculation afterwards. TODO: Should be called from a thread with certain frequency. (should it?)

Specified by:
step in interface AreaInt
See Also:
Neuroid, run()

stop

public void stop()
Terminates the thread dedicated to this area.

Specified by:
stop in interface Simulation
See Also:
thread

fireNeuroid

void fireNeuroid(Neuroid neuroid)
Fires neuroid. Looks up synapses that its axon targets and calls receiveSpike method of all Synapses.

TODO: Make it trigger the Axon to fire.

Parameters:
neuroid - Neuroid to fire
See Also:
Neuroid, Synapse.receiveSpike()

toString

public String toString()
Identifies are with its name.

Specified by:
toString in interface Expressive
Overrides:
toString in class Object
Returns:
a String value

getStatus

public String getStatus()
Mentions the time in addition to toString() contents.

Specified by:
getStatus in interface Expressive
Returns:
a String value
See Also:
Expressive.toString()

getProperties

public String getProperties()
Describe Area in more detail, including static properties.

Specified by:
getProperties in interface Expressive
Returns:
a String value
See Also:
Expressive.getStatus()

run

public void run()
Check if step()ing requested, and serve the request.

Specified by:
run in interface Runnable
See Also:
step()

readObject

private void readObject(ObjectInputStream in)
                 throws IOException,
                        ClassNotFoundException
Method called when a serialized object is loaded. Only customization done is to create a new thread to reside in the transient thread variable.

Parameters:
in - a java.io.ObjectInputStream value
Throws:
IOException - if an error occurs
ClassNotFoundException - if an error occurs