public interface Network extends Node, Probeable
A neural circuit, consisting of Nodes such as Ensembles and ExternalInputs. A Network is the usual object of a simulation. If you are new to this code, what you probably want to do is create some Neurons, group them into Ensembles, connect the Ensembles in a Network, and run the Network in a Simulator.
Note: Multiple steps are needed to add a Projection between Ensembles. First, an Origin must be created on the presynaptic Ensemble, and a Termination with the same dimensionality must be created on the post-synaptic Ensemble. Then the Origin and Termination can be connected with the method addProjection(Origin, Termination). We don't do this in one step (ie automatically create the necessary Origin and Termination as needed) because there are various ways of doing so, and in fact some types of Origins and Terminations can only be created in the course of constructing the Ensemble. Creation of an Origin or Termination can also be a complex process. Rather than try to abstract these varied procedures into something that can be driven from the Network level, we just assume here that the necessary Origins and Terminations exist, and provide a method for connecting them.
VisiblyMutable.Event, VisiblyMutable.Listener, VisiblyMutable.NameChangeEvent, VisiblyMutable.NodeRemovedEvent
Modifier and Type | Method and Description |
---|---|
void |
addNode(Node node) |
Projection |
addProjection(Origin origin,
Termination termination)
Connects an Origin to a Termination.
|
void |
addStepListener(StepListener listener) |
void |
exposeOrigin(Origin origin,
java.lang.String name)
Declares the given Origin as available for connection outside the Network
via getOrigins().
|
void |
exposeState(Probeable probeable,
java.lang.String stateName,
java.lang.String name)
Declares the given Probeable state as being available for Probing from outside this
Network.
|
void |
exposeTermination(Termination termination,
java.lang.String name)
Declares the given Termination as available for connection from outside the Network
via getTerminations().
|
void |
fireStepListeners(float time) |
java.lang.String |
getExposedOriginName(Origin insideOrigin) |
java.lang.String |
getExposedTerminationName(Termination insideTermination) |
java.lang.Object |
getMetaData(java.lang.String key)
Metadata is non-critical information about the Network (eg UI layout) that the user doesn't
access directly.
|
Node |
getNode(java.lang.String name) |
Node[] |
getNodes() |
Projection[] |
getProjections() |
Simulator |
getSimulator() |
void |
hideOrigin(java.lang.String name)
Undoes exposeOrigin(x, x, name).
|
void |
hideState(java.lang.String name)
Undoes exposeState(x, x, name).
|
void |
hideTermination(java.lang.String name)
Undoes exposeTermination(x, x, name).
|
void |
removeNode(java.lang.String name) |
void |
removeProjection(Termination termination) |
void |
removeStepListener(StepListener listener) |
void |
setMetaData(java.lang.String key,
java.lang.Object value) |
void |
setSimulator(Simulator simulator) |
java.lang.String |
toPostScript(java.util.HashMap<java.lang.String,java.lang.Object> scriptData) |
clone, getChildren, getDocumentation, getName, getOrigin, getOrigins, getTermination, getTerminations, notifyAboutDeletion, run, setDocumentation, setName, toScript
reset
getMode, setMode
addChangeListener, removeChangeListener
getHistory, listStates
void addNode(Node node) throws StructuralException
node
- Node to add to the NetworkStructuralException
- if the Network already contains a Node of the same nameNode[] getNodes()
Node getNode(java.lang.String name) throws StructuralException
name
- Name of Node to removeStructuralException
- if named Node does not exist in networkvoid removeNode(java.lang.String name) throws StructuralException
name
- Name of Node to removeStructuralException
- if named Node does not exist in networkProjection addProjection(Origin origin, Termination termination) throws StructuralException
origin
- Origin (data source) of Projection.termination
- Termination (data destination) of Projection.StructuralException
- if the given Origin and Termination have different dimensions,
or if there is already an Origin connected to the given Termination (note that an
Origin can project to multiple Terminations though).Projection[] getProjections()
void removeProjection(Termination termination) throws StructuralException
termination
- Termination of Projection to removeStructuralException
- if there exists no Projection between the specified
Origin and Terminationvoid exposeOrigin(Origin origin, java.lang.String name)
origin
- An Origin within this Network that is to connect to something
outside this Networkname
- Name of the Origin as it will appear outside this Networkjava.lang.String getExposedOriginName(Origin insideOrigin)
insideOrigin
- Origin inside the networkvoid hideOrigin(java.lang.String name) throws StructuralException
name
- Name of Origin to unexpose.StructuralException
- if Origin does not existvoid exposeTermination(Termination termination, java.lang.String name)
termination
- A Termination within this Network that is to connect to something
outside this Networkname
- Name of the Termination as it will appear outside this Networkvoid hideTermination(java.lang.String name)
name
- Name of Termination to unexpose.java.lang.String getExposedTerminationName(Termination insideTermination)
insideTermination
- Termination inside the networkvoid exposeState(Probeable probeable, java.lang.String stateName, java.lang.String name) throws StructuralException
probeable
- A Probeable within this Network.stateName
- A state of the given Probeablename
- A new name with which to access this state via Network.getHistoryStructuralException
- if Probeable not in the Networkvoid hideState(java.lang.String name)
name
- Name of state to unexpose.void setSimulator(Simulator simulator)
simulator
- The Simulator used to run this NetworkSimulator getSimulator()
java.lang.Object getMetaData(java.lang.String key)
key
- Name of a metadata itemvoid setMetaData(java.lang.String key, java.lang.Object value)
key
- Name of a metadata itemvalue
- Value of the named metadata itemjava.lang.String toPostScript(java.util.HashMap<java.lang.String,java.lang.Object> scriptData) throws ScriptGenException
scriptData
- Map of class parent and prefix data for generating python scriptScriptGenException
- if the node cannot be generated in scriptvoid addStepListener(StepListener listener)
void removeStepListener(StepListener listener)
void fireStepListeners(float time)