public final class NetworkComponent extends WorkspaceComponent
Constructor and Description |
---|
NetworkComponent(java.lang.String name)
Create a new network component.
|
NetworkComponent(java.lang.String name,
Network network)
Create a new network component.
|
Modifier and Type | Method and Description |
---|---|
void |
closing()
Perform cleanup after closing.
|
java.lang.String |
getKeyFromObject(java.lang.Object object)
Returns a unique key associated with an object.
|
Network |
getNetwork()
Returns the root network.
|
static PotentialConsumer |
getNeuronConsumer(NetworkComponent component,
Neuron neuron,
java.lang.String methodName)
Helper method for making neuron consumers, since it happens in a few
different places and is important to be consistent about.
|
static PotentialConsumer |
getNeuronGroupConsumer(NetworkComponent component,
NeuronGroup group,
java.lang.String methodName)
Helper method for making neuron group vector consumers, since it happens
in a few different places and is important to be consistent about.
|
static PotentialProducer |
getNeuronGroupProducer(NetworkComponent component,
NeuronGroup group,
java.lang.String methodName)
Helper method for making neuron group producers, since it happens in a
few different places and is important to be consistent about.
|
static PotentialProducer |
getNeuronProducer(NetworkComponent component,
Neuron neuron,
java.lang.String methodName)
Helper method for making neuron producers, since it happens in a few
different places and is important to be consistent about.
|
java.lang.Object |
getObjectFromKey(java.lang.String objectKey)
Finds objects based on a key.
|
java.util.List<PotentialConsumer> |
getPotentialConsumers()
Return the potential consumers associated with this component.
|
java.util.List<PotentialProducer> |
getPotentialProducers()
Return the potential producers associated with this component.
|
static PotentialConsumer |
getSynapseConsumer(NetworkComponent component,
Synapse synapse,
java.lang.String methodName)
Helper method for making synapse consumers, since it happens in a few
different places and is important to be consistent about.
|
static PotentialProducer |
getSynapseProducer(NetworkComponent component,
Synapse synapse,
java.lang.String methodName)
Helper method for making synapse producers, since it happens in a few
different places and is important to be consistent about.
|
java.lang.String |
getXML()
Override for use with open service.
|
static NetworkComponent |
open(java.io.InputStream input,
java.lang.String name,
java.lang.String format) |
void |
save(java.io.OutputStream output,
java.lang.String format)
Used when saving a workspace.
|
void |
update()
Called by Workspace to update the state of the component.
|
addAttributeListener, addConsumerType, addProducerType, addWorkspaceComponentListener, close, couplingAdded, couplingRemoved, fireAttributeObjectRemoved, fireAttributeTypeVisibilityChanged, fireComponentToggleEvent, fireGuiToggleEvent, firePotentialAttributesChanged, fireUpdateEvent, getAttributeManager, getConsumerTypes, getCurrentFile, getDefaultFormat, getFormats, getLocks, getLogger, getName, getProducerTypes, getSerializePriority, getSimpleName, getUpdateOn, getUpdateParts, getVisibleConsumerTypes, getVisibleProducerTypes, getWorkspace, getWorkspaceComponentListeners, hasChangedSinceLastSave, isGuiOn, removeAttributeListener, removeWorkspaceComponentListener, setChangedSinceLastSave, setCurrentFile, setGuiOn, setLogger, setName, setSerializePriority, setUpdateOn, setWorkspace, stopped, toString
public NetworkComponent(java.lang.String name)
name
- namepublic NetworkComponent(java.lang.String name, Network network)
name
- name of networknetwork
- the network being createdpublic static PotentialConsumer getNeuronConsumer(NetworkComponent component, Neuron neuron, java.lang.String methodName)
component
- network componentneuron
- the neuron that will consume activationsmethodName
- the name of the method called by this consumerpublic static PotentialConsumer getSynapseConsumer(NetworkComponent component, Synapse synapse, java.lang.String methodName)
component
- network componentsynapse
- the synapse that will "consume" strengthsmethodName
- the name of the method called by this consumerpublic static PotentialConsumer getNeuronGroupConsumer(NetworkComponent component, NeuronGroup group, java.lang.String methodName)
component
- network componentgroup
- the group that will "consume" activationsmethodName
- the name of the method called by this consumerpublic java.util.List<PotentialConsumer> getPotentialConsumers()
WorkspaceComponent
getPotentialConsumers
in class WorkspaceComponent
public static PotentialProducer getNeuronProducer(NetworkComponent component, Neuron neuron, java.lang.String methodName)
component
- network componentneuron
- the neuron that will produce activationsmethodName
- the name of the method called by this producerpublic static PotentialProducer getNeuronGroupProducer(NetworkComponent component, NeuronGroup group, java.lang.String methodName)
component
- network componentgroup
- the neuron group that will produce activationsmethodName
- the name of the method called by this producerpublic static PotentialProducer getSynapseProducer(NetworkComponent component, Synapse synapse, java.lang.String methodName)
component
- network componentsynapse
- the synapse that will "produce" strengthsmethodName
- the name of the method called by this producerpublic java.util.List<PotentialProducer> getPotentialProducers()
WorkspaceComponent
getPotentialProducers
in class WorkspaceComponent
public java.lang.Object getObjectFromKey(java.lang.String objectKey)
WorkspaceComponent
getObjectFromKey
in class WorkspaceComponent
objectKey
- String keypublic java.lang.String getKeyFromObject(java.lang.Object object)
WorkspaceComponent
getKeyFromObject
in class WorkspaceComponent
object
- object which should be associated with a keypublic static NetworkComponent open(java.io.InputStream input, java.lang.String name, java.lang.String format)
public void save(java.io.OutputStream output, java.lang.String format)
WorkspaceComponent
save
in class WorkspaceComponent
output
- the stream of data to write the data to.format
- a key used to define the requested format.public Network getNetwork()
public void update()
WorkspaceComponent
update
in class WorkspaceComponent
public void closing()
WorkspaceComponent
closing
in class WorkspaceComponent
public java.lang.String getXML()
WorkspaceComponent
getXML
in class WorkspaceComponent