|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.nengo.model.impl.NetworkImpl
public class NetworkImpl
Default implementation of Network.
| Nested Class Summary | |
|---|---|
class |
NetworkImpl.OriginWrapper
Wraps an Origin with a new name (for exposing outside Network). |
class |
NetworkImpl.TerminationWrapper
Wraps a Termination with a new name (for exposing outside Network). |
| Nested classes/interfaces inherited from interface ca.nengo.util.VisiblyMutable |
|---|
VisiblyMutable.Event, VisiblyMutable.Listener, VisiblyMutable.NameChangeEvent |
| Field Summary | |
|---|---|
static java.lang.String |
DEFAULT_NAME
|
| Constructor Summary | |
|---|---|
NetworkImpl()
|
|
| Method Summary | |
|---|---|
void |
addChangeListener(VisiblyMutable.Listener listener)
|
void |
addNode(Node node)
|
void |
addNode(Node node,
boolean includeProbes)
|
Projection |
addProjection(Origin origin,
Termination termination)
Connects an Origin to a Termination. |
void |
changed(VisiblyMutable.Event e)
If the event indicates that a component node's name is changing, checks for name conflicts and throws an exception if there is one, and updates the name reference. |
Network |
clone()
|
void |
collectAllProbes()
Collects probes from every node in this network. |
void |
collectProbes(NetworkImpl network)
Removes all the probes from the specified network (recursively including subnetworks) and adds them to this network. |
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 |
fixMode()
|
java.lang.String |
getDocumentation()
|
java.lang.String |
getExposedOriginName(Origin insideOrigin)
Returns the name of the exposed origin given the inner origin. |
java.lang.String |
getExposedTerminationName(Termination insideTermination)
Returns the name of the exposed termination given the inner termination. |
TimeSeries |
getHistory(java.lang.String stateName)
Note that the units of TimeSeries' for a given state do not change over time (ie at different time steps). |
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. |
SimulationMode |
getMode()
|
java.lang.String |
getName()
|
Node |
getNode(java.lang.String name)
|
Node[] |
getNodes()
|
Origin |
getOrigin(java.lang.String name)
|
Origin[] |
getOrigins()
|
Projection[] |
getProjections()
|
Simulator |
getSimulator()
|
float |
getStepSize()
|
Termination |
getTermination(java.lang.String name)
|
Termination[] |
getTerminations()
|
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). |
java.util.Properties |
listStates()
|
void |
removeChangeListener(VisiblyMutable.Listener listener)
|
void |
removeNode(java.lang.String name)
|
void |
removeProjection(Termination termination)
|
void |
reset(boolean randomize)
|
void |
run(float startTime,
float endTime)
Runs the Node (including all its components), updating internal state and outputs as needed. |
void |
setDocumentation(java.lang.String text)
|
void |
setMetaData(java.lang.String key,
java.lang.Object value)
|
void |
setMode(SimulationMode mode)
Sets the object to run in either the given mode or the closest mode that it supports (all ModeConfigurables must support SimulationMode.DEFAULT, and must default to this mode). |
void |
setName(java.lang.String name)
|
void |
setSimulator(Simulator simulator)
|
void |
setStepSize(float stepSize)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String DEFAULT_NAME
| Constructor Detail |
|---|
public NetworkImpl()
| Method Detail |
|---|
public void setSimulator(Simulator simulator)
setSimulator in interface Networksimulator - Simulator with which to run this Networkpublic Simulator getSimulator()
getSimulator in interface Networkpublic void setStepSize(float stepSize)
stepSize - New timestep size at which to simulate Network (some components of the network
may run with different step sizes, but information is exchanged between components with
this step size). Defaults to 0.001s.public float getStepSize()
public void addNode(Node node)
throws StructuralException
addNode in interface Networknode - Node to add to the Network
StructuralException - if the Network already contains a Node of the same nameNetwork.addNode(ca.nengo.model.Node)
public void addNode(Node node,
boolean includeProbes)
throws StructuralException
node - Node to add to the NetworkincludeProbes - if true, when the node being added is a network any probes in that network will also be added
StructuralException - if the Network already contains a Node of the same namepublic void collectProbes(NetworkImpl network)
network - the network to collect probes frompublic void collectAllProbes()
public void changed(VisiblyMutable.Event e)
throws StructuralException
changed in interface VisiblyMutable.Listenere - An object that has changed in some way (all properties
that influence the display of the object should be checked)
StructuralExceptionVisiblyMutable.Listener.changed(ca.nengo.util.VisiblyMutable.Event)public Node[] getNodes()
getNodes in interface NetworkNetwork.getNodes()
public Node getNode(java.lang.String name)
throws StructuralException
getNode in interface Networkname - Name of Node to remove
StructuralException - if named Node does not exist in networkNetwork.getNode(java.lang.String)
public void removeNode(java.lang.String name)
throws StructuralException
removeNode in interface Networkname - Name of Node to remove
StructuralException - if named Node does not exist in networkNetwork.removeNode(java.lang.String)
public Projection addProjection(Origin origin,
Termination termination)
throws StructuralException
Network
addProjection in interface Networkorigin - 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).Network.addProjection(ca.nengo.model.Origin, ca.nengo.model.Termination)public Projection[] getProjections()
getProjections in interface NetworkNetwork.getProjections()
public void removeProjection(Termination termination)
throws StructuralException
removeProjection in interface Networktermination - Termination of Projection to remove
StructuralException - if there exists no Projection between the specified
Origin and TerminationNetwork.removeProjection(ca.nengo.model.Termination)public java.lang.String getName()
getName in interface NodeNode.getName()
public void setName(java.lang.String name)
throws StructuralException
setName in interface Nodename - New name of Network (must be unique within any networks of which this one
will be a part)
StructuralExceptionpublic void setMode(SimulationMode mode)
SimulationMode.ModeConfigurable
setMode in interface SimulationMode.ModeConfigurablemode - SimulationMode in which it is desired that the object runs.SimulationMode.ModeConfigurable.setMode(ca.nengo.model.SimulationMode)public void fixMode()
public SimulationMode getMode()
getMode in interface SimulationMode.ModeConfigurableSimulationMode.ModeConfigurable.getMode()
public void run(float startTime,
float endTime)
throws SimulationException
Node
run in interface NodestartTime - simulation time at which running starts (s)endTime - simulation time at which running ends (s)
SimulationException - if a problem is encountered while trying to runNode.run(float, float)public void reset(boolean randomize)
reset in interface Resettablerandomize - True indicates that the object should be reset to a
randomly selected initial state (the object must be aware of the
distribution from which to draw from). False indicates that the
object should be reset to a fixed initial state (which it must
also know). Some objects may not support randomization of the initial
state, in which case a fixed state will be used in either case.Resettable.reset(boolean)
public TimeSeries getHistory(java.lang.String stateName)
throws SimulationException
Probeable
getHistory in interface ProbeablestateName - A state variable name
SimulationException - if the Probeable does not have the requested stateProbeable.getHistory(java.lang.String)public java.util.Properties listStates()
listStates in interface ProbeableProbeable.listStates()
public void exposeOrigin(Origin origin,
java.lang.String name)
Network
exposeOrigin in interface Networkorigin - An Origin within this Network that is to connect to something
outside this Networkname - Name of the Origin as it will appear outside this NetworkNetwork.exposeOrigin(ca.nengo.model.Origin,
java.lang.String)public void hideOrigin(java.lang.String name)
Network
hideOrigin in interface Networkname - Name of Origin to unexpose.Network.hideOrigin(java.lang.String)public java.lang.String getExposedOriginName(Origin insideOrigin)
Network
getExposedOriginName in interface NetworkinsideOrigin - Origin inside the networkNetwork.getExposedOriginName(ca.nengo.model.Origin)
public Origin getOrigin(java.lang.String name)
throws StructuralException
getOrigin in interface Nodename - Name of an Origin on this Node
StructuralException - if the named Origin does not existNode.getOrigin(java.lang.String)public Origin[] getOrigins()
getOrigins in interface NodeNode.getOrigins()
public void exposeTermination(Termination termination,
java.lang.String name)
Network
exposeTermination in interface Networktermination - A Termination within this Network that is to connect to something
outside this Networkname - Name of the Termination as it will appear outside this NetworkNetwork.exposeTermination(ca.nengo.model.Termination, java.lang.String)public void hideTermination(java.lang.String name)
Network
hideTermination in interface Networkname - Name of Termination to unexpose.Network.hideTermination(java.lang.String)public java.lang.String getExposedTerminationName(Termination insideTermination)
Network
getExposedTerminationName in interface NetworkinsideTermination - Termination inside the networkNetwork.getExposedTerminationName(ca.nengo.model.Termination)
public Termination getTermination(java.lang.String name)
throws StructuralException
getTermination in interface Nodename - Name of a Termination onto this Node
StructuralException - if the named Termination does not existNode.getTermination(java.lang.String)public Termination[] getTerminations()
getTerminations in interface NodeNode.getTerminations()
public void exposeState(Probeable probeable,
java.lang.String stateName,
java.lang.String name)
throws StructuralException
Network
exposeState in interface Networkprobeable - A Probeable within this Network.stateName - A state of the given Probeablename - A new name with which to access this state via Network.getHistory
StructuralExceptionNetwork.exposeState(ca.nengo.model.Probeable, java.lang.String, java.lang.String)public void hideState(java.lang.String name)
Network
hideState in interface Networkname - Name of state to unexpose.Network.hideState(java.lang.String)public java.lang.String getDocumentation()
getDocumentation in interface NodeNode.getDocumentation()public void setDocumentation(java.lang.String text)
setDocumentation in interface Nodetext - New user-specified documentation for the NodeNode.setDocumentation(java.lang.String)public java.lang.Object getMetaData(java.lang.String key)
Network
getMetaData in interface Networkkey - Name of a metadata item
Network.getMetaData(java.lang.String)
public void setMetaData(java.lang.String key,
java.lang.Object value)
setMetaData in interface Networkkey - Name of a metadata itemvalue - Value of the named metadata itemNetwork.setMetaData(java.lang.String, java.lang.Object)public void addChangeListener(VisiblyMutable.Listener listener)
addChangeListener in interface VisiblyMutablelistener - Listener to addVisiblyMutable.addChangeListener(ca.nengo.util.VisiblyMutable.Listener)public void removeChangeListener(VisiblyMutable.Listener listener)
removeChangeListener in interface VisiblyMutablelistener - Listener to removeVisiblyMutable.removeChangeListener(ca.nengo.util.VisiblyMutable.Listener)
public Network clone()
throws java.lang.CloneNotSupportedException
clone in interface Nodeclone in class java.lang.Objectjava.lang.CloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||