|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbrain.ModuleAdapter
public abstract class ModuleAdapter
This class provides default implementations for the Module
interface. Standard behaviors like the get, set, add, remove methods are defined here. This class also provides basic graph calculation. The developer need only subclass this class and implement calculateOneTimeStep and define its own important methods.
Field Summary | |
---|---|
protected java.util.List<java.lang.Double> |
activities
Array with the activities of the individual neurons. |
protected java.util.Map<Module,double[][]> |
afferentModules
HashMap with string-identifiers and inter-modular link matrices. |
protected javax.swing.event.EventListenerList |
changeListeners
Listeners to be notified of module changes. |
protected java.util.Set<java.util.Set<java.lang.Integer>> |
cliques
The calculated cliques for this graph. |
protected double |
elapsedTime
The time elapsed for this module. |
protected long |
elapsedTimeSteps
The number of time steps elapsed for this module. |
protected java.util.Map<Module,java.lang.String> |
forwardModules
HashMap with string-identifiers and identifier of the receiving port of the target module. |
protected java.util.HashMap<java.lang.String,java.lang.Double> |
receptors
HashMap with string-identifiers encoding the open ports for the individual receptors. |
Constructor Summary | |
---|---|
ModuleAdapter()
|
Method Summary | |
---|---|
void |
addAfferentModule(Module module)
Adds a module to the HashMap `afferentModules'. |
void |
addChangeListener(javax.swing.event.ChangeListener listener)
|
void |
addForwardModule(Module module,
java.lang.String whichPort)
Adds a module to the HashMap `forwardModules'. |
void |
addReceptor(java.lang.String receptorType,
double addValue)
Adds contribution `addValue' to the specified receptor field, returning `false' if specified receptor does not exist. |
protected abstract void |
calculateOneTimeStep(double timeDelta)
calculates one time step of the simulation calculation This method has to be implemented by subclasses. |
java.util.List<java.util.List<java.lang.Double>> |
cliqueGraph()
returns the clique graph of the graph as an adjacency matrix |
java.util.Set<java.util.Set<java.lang.Integer>> |
cliques()
Returns the cliques of the graph. |
void |
createTGFGraph(java.io.File tgfFile)
http://en.wikipedia.org/wiki/Trivial_Graph_Format |
int[] |
degreeDistribution()
Returns the degree distribution of the graph. |
java.util.List<java.lang.Double> |
getActivities()
Returns the activities levels. |
double |
getActivity(int i)
Returns the activities level of a given center. |
double[][] |
getAfferentLinks(Module module)
Returns the array which holds the backward links to a given module |
Module[] |
getAfferentModules()
Returns all backward module names as an ArrayList of Strings. |
double |
getElapsedTime()
returns the time elapsed |
long |
getElapsedTimeSteps()
returns the number of time steps elapsed |
Module[] |
getForwardModules()
Returns all forward module names as an ArrayList of Strings. |
double |
getReceptor(java.lang.String receptorType)
Returns the value of the specified receptor field. |
java.util.Map<java.lang.String,java.lang.Double> |
getReceptors()
Returns receptors of a module |
boolean |
hasAfferentModule(Module module)
|
boolean |
hasForwardModule(Module module)
|
java.util.List<java.util.Set<java.lang.Integer>> |
neighbors()
returns all the neighbors for all the vertices |
int[] |
nodeDegrees()
Returns the degrees of the vertices. |
protected void |
notifyStateChanged(javax.swing.event.ChangeEvent event)
|
void |
performOneTimeStep(double timeDelta)
performs one time step of the simulation calculation |
void |
removeAfferentModule(Module module)
Removes a module from the HashMap `afferentModules'. |
void |
removeAfferentModules()
Removes all modules from the HashMap `afferentModules'. |
void |
removeChangeListener(javax.swing.event.ChangeListener listener)
|
void |
removeForwardModule(Module module)
Removes a particular forward module from the HashMap of forward modules. |
void |
removeForwardModules()
Remove all forward modules from the HashMap of forward modules. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface brain.Module |
---|
addBias, getBias, getLink, getName, getSize, reset, setLink |
Field Detail |
---|
protected javax.swing.event.EventListenerList changeListeners
protected java.util.Map<Module,java.lang.String> forwardModules
The geometry of the forward connection, specific to the `ModuleDhan' module. The
receiving port (receptors for the neuromodulator) is given by the second
argument of `forwardModules'.
protected java.util.Map<Module,double[][]> afferentModules
The geometry of the backward connection, is a all-to-all adaptive connection.
protected java.util.List<java.lang.Double> activities
protected java.util.HashMap<java.lang.String,java.lang.Double> receptors
The receptors are targeted by the diffusive module signals of other (or this)
modules, via the respective forward connection, stored in the respective
`forwardModules'.
The allowed types of receptors, the cues of the HashMap, are stored in
`auxMyReceptorsAllowedValues'.
protected long elapsedTimeSteps
protected double elapsedTime
protected java.util.Set<java.util.Set<java.lang.Integer>> cliques
Constructor Detail |
---|
public ModuleAdapter()
Method Detail |
---|
public long getElapsedTimeSteps()
getElapsedTimeSteps
in interface Module
public double getElapsedTime()
getElapsedTime
in interface Module
public final void performOneTimeStep(double timeDelta)
performOneTimeStep
in interface Module
protected abstract void calculateOneTimeStep(double timeDelta)
timeDelta
- public java.util.List<java.lang.Double> getActivities()
getActivities
in interface Module
public double getActivity(int i)
getActivity
in interface Module
public void addAfferentModule(Module module)
addAfferentModule
in interface Module
module
- -
the module to which this module connectspublic Module[] getAfferentModules()
getAfferentModules
in interface Module
public void removeAfferentModule(Module module)
Module
removeAfferentModule
in interface Module
public void removeAfferentModules()
Module
removeAfferentModules
in interface Module
public boolean hasAfferentModule(Module module)
hasAfferentModule
in interface Module
public double[][] getAfferentLinks(Module module)
Module
getAfferentLinks
in interface Module
public void addForwardModule(Module module, java.lang.String whichPort)
Module
addForwardModule
in interface Module
public Module[] getForwardModules()
--class ModuleDhan--
getForwardModules
in interface Module
public void removeForwardModule(Module module)
--class ModuleDhan--
removeForwardModule
in interface Module
module
- name of module to removepublic void removeForwardModules()
--class ModuleDhan--
removeForwardModules
in interface Module
public boolean hasForwardModule(Module module)
hasForwardModule
in interface Module
public void addReceptor(java.lang.String receptorType, double addValue)
addReceptor
in interface Module
public double getReceptor(java.lang.String receptorType)
getReceptor
in interface Module
public java.util.Map<java.lang.String,java.lang.Double> getReceptors()
Module
getReceptors
in interface Module
public java.lang.String toString()
toString
in class java.lang.Object
public void addChangeListener(javax.swing.event.ChangeListener listener)
addChangeListener
in interface Module
public void removeChangeListener(javax.swing.event.ChangeListener listener)
removeChangeListener
in interface Module
protected void notifyStateChanged(javax.swing.event.ChangeEvent event)
public int[] nodeDegrees()
nodeDegrees
in interface Module
public int[] degreeDistribution()
degreeDistribution
in interface Module
public java.util.Set<java.util.Set<java.lang.Integer>> cliques()
cliques
in interface Module
public java.util.List<java.util.Set<java.lang.Integer>> neighbors()
public java.util.List<java.util.List<java.lang.Double>> cliqueGraph()
cliqueGraph
in interface Module
public void createTGFGraph(java.io.File tgfFile) throws java.io.FileNotFoundException
createTGFGraph
in interface Module
tgfFile
-
java.io.FileNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |