#include <network_base.hpp>
|
void | connect (PopulationIndex pid_src, NeuronIndex nid_src0, NeuronIndex nid_src1, PopulationIndex pid_tar, NeuronIndex nid_tar0, NeuronIndex nid_tar1, std::unique_ptr< Connector > connector, const char *name="") |
|
PopulationIndex | create_population_index (size_t size, const NeuronType &type, const NeuronParameters ¶ms, const NeuronSignals &signals, const std::string &name) |
|
|
template<typename Impl , typename Accessor > |
class | PopulationMixin |
|
template<typename Impl , typename Accessor , typename Params , typename Signals > |
class | DataMixin |
|
template<typename Impl , typename Accessor > |
class | ConnectableMixin |
|
The NetworkBase class represents an entire spiking neural network. Note that this class only represents a lightweight handle at the actual network, copying this handle does not create a new network instance. Use the clone() method to create a new NetworkBase instance.
cypress::NetworkBase::NetworkBase |
( |
| ) |
|
Default constructor. Creates a new network.
cypress::NetworkBase::NetworkBase |
( |
std::shared_ptr< internal::NetworkData > |
impl | ) |
|
|
inline |
Creates a network instance with a reference at an already existing network. Used internally.
cypress::NetworkBase::~NetworkBase |
( |
| ) |
|
Destructor. Destroys this network instance and the handle pointing at underlying network.
Creates and returns a copy of the network.
Base connection method. Connects a range of neurons in the source population to a range of neurons in the target population. All connection methods in ConnectableMixin are relayed to this method.
- Parameters
-
pid_src | is the index of the source population. |
nid_src0 | is the index of the first neuron in this population that is going to be connected. |
nid_src1 | is the index of the last-plus-one neuron in this population being connected. |
pid_tar | is the index of the target population. |
nid_tar0 | is the index of the first neuron in the target population that is going to be connected. |
nid_tar1 | is the index of the last-plus-one neuron in the target population that is going to be connected. |
connector | is a connector which is used to construct the actual neuron-to-neuron connections on demand. |
Returns a a reference at ConnectionDescriptor instances with name, describing the connection between the individual populations.
- Returns
- a reference at the first connection stored in the network instance with name
Returns a a reference at a list of ConnectionDescriptor instances, describing the connections between the individual populations.
- Returns
- a reference at the internal list of connections stored in the network instance.
Internally used to add a new population. Use the templated public create_population method in the Network class instead.
- Parameters
-
size | is the number of neurons in the population. |
type | is the type of the neurons in the population. |
params | contains the initial neuron parameters. The parameters may be a list of neuron parameters, in which case the size of the list must be equal to the size of the population. |
signals | contains the initial flags describing which signals should be recorded. The signals object may contain a list of signal instances, in which case the size of the list must be equal to the size of the population. |
name | is the name of the population. |
const std::unordered_set<std::string>& cypress::NetworkBase::disabled_trafo_ids |
( |
| ) |
const |
Returns the list of currently disabled transformation ids.
std::unordered_set<std::string>& cypress::NetworkBase::disabled_trafo_ids |
( |
| ) |
|
Returns the list of currently disabled transformation ids.
Real cypress::NetworkBase::duration |
( |
| ) |
const |
Returns the duration of the network. The duration is defined as the last spike stored in a SpikeSourceArray.
- Returns
- the duration of the network in milliseconds.
Logger& cypress::NetworkBase::logger |
( |
| ) |
const |
Returns the logger that should be used to log messages related to this network. The "global_logger()" is used per default.
void cypress::NetworkBase::logger |
( |
Logger & |
logger | ) |
|
Sets a new logger that should be used to log messages related to this network.
static std::unique_ptr<Backend> cypress::NetworkBase::make_backend |
( |
std::string |
backend_id, |
|
|
int |
argc = 0 , |
|
|
const char * |
argv[] = nullptr , |
|
|
Json |
setup = Json() |
|
) |
| |
|
static |
Returns the backend instance for the given backend string. The backend string may be one of the following:
- nest: executes the network using the native nest backend
- pynn.*: executes the network using the given PyNN backend
- nmpi.*: executes the network using NMPI and the given PyNN backend.
- nmpi.pynn.*: same as above.
- Parameters
-
backend_id | is the id of the backend that should be created. |
argc | is the number of command line arguments. Needed when the NMPI backend should be used. |
argv | is the array containing the command line arguments. Needed when the NMPI backend should be used. |
setup | is an optional Json object which contains backend configuration. |
- Returns
- a pointer at a new backend instance.
size_t cypress::NetworkBase::neuron_count |
( |
| ) |
const |
Returns the total number of neurons in the network.
size_t cypress::NetworkBase::neuron_count |
( |
const NeuronType & |
type | ) |
const |
Returns the number of neurons of a given type.
template<typename T >
size_t cypress::NetworkBase::neuron_count |
( |
| ) |
const |
|
inline |
Returns the number of neurons of a certain neuron type.
bool cypress::NetworkBase::operator!= |
( |
const NetworkBase & |
o | ) |
const |
|
inline |
Compares whether two NetworkBase instances point at different underlying network instances.
bool cypress::NetworkBase::operator== |
( |
const NetworkBase & |
o | ) |
const |
|
inline |
Compares whether two NetworkBase instances point at the same underlying network.
Returns a PopulationBase instance pointing at the population with the given index.
PopulationBase cypress::NetworkBase::population |
( |
const std::string & |
name = std::string() | ) |
|
Returns a Population object pointing at the last created population with the given name. If no such population exists, an exception is thrown.
- Parameters
-
name | is the name of the population that should be looked up. If empty, the last created population is returned. |
- Returns
- a population handle pointing at the requested population.
size_t cypress::NetworkBase::population_count |
( |
| ) |
const |
Returns the number of created populations.
size_t cypress::NetworkBase::population_count |
( |
const NeuronType & |
type | ) |
const |
Returns the number of populations of a certain neuron type.
template<typename T >
size_t cypress::NetworkBase::population_count |
( |
| ) |
const |
|
inline |
Returns the number of populations of a certain neuron type.
Returns the raw population data associated with the given population index. Try to avoid using this function directly. Proper use cases are network transformations.
- Parameters
-
pid | is the index of the population for which a reference at the internal data should be returned. |
Returns the raw population data associated with the given population index. Try to avoid using this function directly. Proper use cases are network transformations.
- Parameters
-
pid | is the index of the population for which a reference at the internal data should be returned. |
Returns a list of populations available in the network, filtered by the given name and type.
- Parameters
-
name | is the name the returned populations should be filtered by. If an empty string is given, no filtering is performed (default). |
type | is the neuron type the list should be filtered for. If a pointer at the special NullNeuron instance is given, no filtering by type is performed (default). |
- Returns
- a list of PopulationBase instances, pointing at the populations matching the given requirements.
Returns a list of populations filtered by the given neuron type.
- Parameters
-
type | is the neuron type the list should be filtered for. If a pointer at the special NullNeuron instance is given, no filtering by type is performed (default). |
- Returns
- a list of PopulationBase instances, pointing at the populations matching the given requirements.
void cypress::NetworkBase::run |
( |
const Backend & |
backend, |
|
|
Real |
duration = 0.0 |
|
) |
| |
Executes the network on the given backend and stores the results in the population objects. This function is simply a wrapper for Backend.run(). If there is an error during execution, the run function will throw a exception.
- Parameters
-
backend | is a reference at the backend instance the network should be executed on. |
duration | is the simulation-time. If a value smaller or equal to zero is given, the simulation time is automatically chosen. |
void cypress::NetworkBase::run |
( |
const std::string & |
backend_id, |
|
|
Real |
duration = 0.0 , |
|
|
int |
argc = 0 , |
|
|
const char * |
argv[] = nullptr |
|
) |
| |
Executes the network on the given backend and stores the results in the population objects. This function is simply a wrapper for Backend.run(). If there is an error during execution, the run function will throw a exception.
- Parameters
-
backend_id | is a string describing the backend instance. See make_backend() for more information on available backend strings. |
argc | is the number of command line arguments. Needed when the NMPI backend should be used. |
argv | is the array containing the command line arguments. Needed when the NMPI backend should be used. |
duration | is the simulation-time. If a value smaller or equal to zero is given, the simulation time is automatically chosen. |
Returns information about the network runtime. Behaviour is undefined if the network has not yet been executed.
Allows to set the runtime information to the given values.
void cypress::NetworkBase::update_connection |
( |
std::unique_ptr< Connector > |
connector, |
|
|
const char * |
name |
|
) |
| |
Change the connector from an existing connection.
- Parameters
-
connector | The new connector |
name | Name tag of the target connection |
bool cypress::NetworkBase::use_lossy_trafos |
( |
| ) |
const |
Returns the state of the "use_lossy_trafos" flag. If true, applies possibly lossy transformations to the network in order to run it on the target platform. The default value is "true".
void cypress::NetworkBase::use_lossy_trafos |
( |
bool |
use_lossy | ) |
const |
Sets the "use_lossy_trafos" flag. If true, allows to apply lossy transformations to allow running a network on the target platform. The defautl value is "true".
template<typename Impl , typename Accessor >
template<typename Impl , typename Accessor , typename Params , typename Signals >
template<typename Impl , typename Accessor >
The documentation for this class was generated from the following file: