NEST  2.6.0,not_revisioned_source_dir@0
Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Friends | List of all members

Main administrative interface to the network. More...

#include <network.h>

Classes

struct  MusicPortData
 Data structure to hold variables and parameters associated with a port. More...
 

Public Member Functions

 Network (SLIInterpreter &)
 
 ~Network ()
 
void reset ()
 Reset deletes all nodes and reallocates all memory pools for nodes. More...
 
void reset_kernel ()
 Reset number of threads to one, reset device prefix to the empty string and call reset(). More...
 
void reset_network ()
 Reset the network to the state at T = 0. More...
 
void register_basis_model (Model &m, bool private_model=false)
 Registers a fundamental model for use with the network. More...
 
index register_model (Model &m, bool private_model=false)
 Register a built-in model for use with the network. More...
 
void unregister_model (index m_id)
 Unregister a previously registered model. More...
 
void try_unregister_model (index m_id)
 Try unregistering model prototype. More...
 
index copy_model (index old_id, std::string new_name)
 Copy an existing model and register it as a new model. More...
 
synindex register_synapse_prototype (ConnectorModel *cf)
 Register a synapse prototype at the connection manager. More...
 
int copy_synapse_prototype (index sc, std::string)
 Copy an existing synapse type. More...
 
template<typename ConnBuilder >
void register_conn_builder (const std::string &name)
 Add a connectivity rule, i.e. More...
 
int get_model_id (const char[]) const
 Return the model id for a given model name. More...
 
Modelget_model (index) const
 Return the Model for a given model ID. More...
 
Modelget_model_of_gid (index)
 Return the Model for a given GID. More...
 
index get_model_id_of_gid (index)
 Return the Model ID for a given GID. More...
 
const modelrangeget_contiguous_gid_range (index gid) const
 Return the contiguous range of ids of nodes with the same model than the node with the given GID. More...
 
index add_node (index m, long_t n=1)
 Add a number of nodes to the network. More...
 
void restore_nodes (ArrayDatum &)
 Restore nodes from an array of status dictionaries. More...
 
void init_state (index)
 Set the state (observable dynamic variables) of a node to model defaults. More...
 
index size () const
 Return total number of network nodes. More...
 
void connect (index s, Node *target, thread target_thread, index syn, double_t d=NAN, double_t w=NAN)
 Connect two nodes. More...
 
void connect (index s, Node *target, thread target_thread, index syn, DictionaryDatum &params, double_t d=NAN, double_t w=NAN)
 Connect two nodes. More...
 
bool connect (index s, index r, DictionaryDatum &params, index syn)
 Connect two nodes. More...
 
void subnet_connect (Subnet &, Subnet &, int, index syn)
 
void connect (ArrayDatum &connectome)
 Connect from an array of dictionaries. More...
 
void divergent_connect (index s, const TokenArray r, const TokenArray weights, const TokenArray delays, index syn)
 
void divergent_connect (index s, DictionaryDatum d, index syn)
 Connect one source node with many targets. More...
 
void random_divergent_connect (index s, const TokenArray r, index n, const TokenArray w, const TokenArray d, bool, bool, index syn)
 
void convergent_connect (const TokenArray s, index r, const TokenArray weights, const TokenArray delays, index syn)
 
void convergent_connect (const std::vector< index > &s_id, index r, const TokenArray &weight, const TokenArray &delays, index syn)
 Specialized version of convegent_connect called by random_convergent_connect threaded. More...
 
void random_convergent_connect (const TokenArray s, index t, index n, const TokenArray w, const TokenArray d, bool, bool, index syn)
 
void random_convergent_connect (TokenArray s, TokenArray t, TokenArray n, TokenArray w, TokenArray d, bool, bool, index syn)
 Use openmp threaded parallelization to speed up connection. More...
 
void connect (const GIDCollection &, const GIDCollection &, const DictionaryDatum &, const DictionaryDatum &)
 Create connections. More...
 
DictionaryDatum get_connector_defaults (index sc)
 
void set_connector_defaults (index sc, DictionaryDatum &d)
 
DictionaryDatum get_synapse_status (index gid, index syn, port p, thread tid)
 
void set_synapse_status (index gid, index syn, port p, thread tid, DictionaryDatum &d)
 
ArrayDatum get_connections (DictionaryDatum dict)
 
Subnetget_root () const
 return root subnet. More...
 
Subnetget_cwn () const
 current working node. More...
 
void go_to (index)
 Change current working node. More...
 
void simulate (Time const &)
 
void resume ()
 Resume the simulation after it was terminated. More...
 
void terminate ()
 Terminate the simulation after the time-slice is finished. More...
 
bool quit_by_error () const
 Return true if NEST will be quit because of an error, false otherwise. More...
 
int get_exitcode () const
 Return the exitcode that would be returned to the calling shell if NEST would quit now. More...
 
void memory_info ()
 
void print (index, int)
 
void trigger_update_weight (const long_t vt_gid, const vector< spikecounter > &dopa_spikes, const double_t t_trig)
 Triggered by volume transmitter in update. More...
 
template<class EventT >
void send (Node &source, EventT &e, const long_t lag=0)
 Standard routine for sending events. More...
 
void send_local (thread t, Node &source, Event &e)
 Send event e to all targets of node source on thread t. More...
 
void send_to_node (Event &e)
 Send event e directly to its target node. More...
 
delay get_min_delay () const
 Return minimal connection delay. More...
 
delay get_max_delay () const
 Return maximal connection delay. More...
 
Time const & get_slice_origin () const
 Get the time at the beginning of the current time slice. More...
 
Time get_previous_slice_origin () const
 Get the time at the beginning of the previous time slice. More...
 
Time const get_time () const
 Get the current simulation time. More...
 
librandom::RngPtr get_rng (thread thrd=0) const
 Get random number client of a thread. More...
 
librandom::RngPtr get_grng () const
 Get global random number client. More...
 
thread get_num_threads () const
 Get number of threads. More...
 
thread suggest_vp (index) const
 Suggest a VP for a given global node ID. More...
 
thread suggest_rec_vp (index) const
 Suggest a VP for a given global recording node ID. More...
 
thread vp_to_thread (thread vp) const
 Convert a given VP ID to the corresponding thread ID. More...
 
thread thread_to_vp (thread t) const
 Convert a given thread ID to the corresponding VP ID. More...
 
thread get_num_processes () const
 Get number of processes. More...
 
thread get_num_rec_processes () const
 Get number of recording processes. More...
 
thread get_num_sim_processes () const
 Get number of simulating processes. More...
 
void set_num_rec_processes (int nrp)
 Set number of recording processes. More...
 
bool is_local_node (Node *) const
 Return true, if the given Node is on the local machine. More...
 
bool is_local_gid (index gid) const
 Return true, if the given gid is on the local machine. More...
 
bool is_local_vp (thread) const
 Return true, if the given VP is on the local machine. More...
 
bool get_simulated () const
 See Scheduler::get_simulated() More...
 
Nodeget_node (index, thread thr=0)
 Return pointer of the specified Node. More...
 
const SiblingContainerget_thread_siblings (index n) const
 Return the Subnet that contains the thread siblings. More...
 
bool model_in_use (index i)
 Check, if there are instances of a given model. More...
 
const std::string & get_data_prefix () const
 The prefix for files written by devices. More...
 
const std::string & get_data_path () const
 The path for files written by devices. More...
 
bool overwrite_files () const
 Indicate if existing data files should be overwritten. More...
 
bool get_off_grid_communication () const
 return current communication style. More...
 
void set_status (index, const DictionaryDatum &)
 Set properties of a Node. More...
 
DictionaryDatum get_status (index)
 Get properties of a node. More...
 
int execute_sli_protected (DictionaryDatum, Name)
 Execute a SLI command in the neuron's namespace. More...
 
const Dictionaryget_modeldict ()
 Return a reference to the model dictionary. More...
 
const Dictionaryget_synapsedict () const
 Return the synapse dictionary. More...
 
void calibrate_clock ()
 Recalibrate scheduler clock. More...
 
size_t write_toggle () const
 Return 0 for even, 1 for odd time slices. More...
 
size_t read_toggle () const
 Return 1 - write_toggle(). More...
 
bool has_user_models () const
 Does the network contain copies of models created using CopyModel? More...
 
void ensure_valid_thread_local_ids ()
 Ensure that all nodes in the network have valid thread-local IDs. More...
 
void message (int level, const char from[], const char text[])
 Display a message. More...
 
void message (int level, const std::string &loc, const std::string &msg)
 
bool dict_miss_is_error () const
 Returns true if unread dictionary items should be treated as error. More...
 
void register_music_in_port (std::string portname)
 Register a MUSIC input port (portname) with the port list. More...
 
void unregister_music_in_port (std::string portname)
 Unregister a MUSIC input port (portname) from the port list. More...
 
void register_music_event_in_proxy (std::string portname, int channel, nest::Node *mp)
 Register a node (of type music_input_proxy) with a given MUSIC port (portname) and a specific channel. More...
 
void set_music_in_port_acceptable_latency (std::string portname, double_t latency)
 Set the acceptable latency (latency) for a music input port (portname). More...
 
void set_music_in_port_max_buffered (std::string portname, int_t maxbuffered)
 
void publish_music_in_ports_ ()
 Publish all MUSIC input ports that were registered using Network::register_music_event_in_proxy(). More...
 
void update_music_event_handlers_ (Time const &, const long_t, const long_t)
 Call update() for each of the registered MUSIC event handlers to deliver all queued events to the target music_in_proxies. More...
 
int get_thread_id () const
 Gets ID of local thread. More...
 
void set_model_defaults_modified ()
 
bool model_defaults_modified () const
 
Nodethread_lid_to_node (thread t, targetindex thread_local_id) const
 
template<>
void send (Node &source, SpikeEvent &e, const long_t lag)
 
template<>
void send (Node &source, DSSpikeEvent &e, const long_t lag)
 

Public Attributes

std::map< std::string,
MusicPortData
music_in_portlist_
 The mapping between MUSIC input ports identified by portname and the corresponding port variables and parameters. More...
 
std::map< std::string,
MusicEventHandler
music_in_portmap_
 The mapping between MUSIC input ports identified by portname and the corresponding MUSIC event handler. More...
 

Private Member Functions

void init_ ()
 Initialize the network data structures. More...
 
void destruct_nodes_ ()
 
void clear_models_ (bool called_from_destructor=false)
 
void set_status_single_node_ (Node &, const DictionaryDatum &, bool clear_flags=true)
 Helper function to set properties on single node. More...
 
void set_data_path_prefix_ (const DictionaryDatum &d)
 Helper function to set device data path and prefix. More...
 

Private Attributes

SLIInterpreterinterpreter_
 
SparseNodeArray local_nodes_
 The network as sparse array of local nodes. More...
 
Scheduler scheduler_
 
ConnectionManager connection_manager_
 
Subnetroot_
 Root node. More...
 
Subnetcurrent_
 Current working node (for insertion). More...
 
Dictionarysynapsedict_
 Dictionary for synapse models. More...
 
Dictionarymodeldict_
 Dictionary for models. More...
 
Dictionaryconnruledict_
 Dictionary for connection rules. More...
 
Modelsiblingcontainer_model
 The model for the SiblingContainer class. More...
 
std::string data_path_
 Path for all files written by devices. More...
 
std::string data_prefix_
 Prefix for all files written by devices. More...
 
bool overwrite_files_
 If true, overwrite existing data files. More...
 
std::vector< std::pair< Model
*, bool > > 
pristine_models_
 The list of clean models. More...
 
std::vector< Model * > models_
 The list of available models. More...
 
std::vector< std::vector< Node * > > proxy_nodes_
 Placeholders for remote nodes, one per thread. More...
 
std::vector< Node * > dummy_spike_sources_
 Placeholders for spiking remote nodes, one per thread. More...
 
std::vector
< GenericConnBuilderFactory * > 
connbuilder_factories_
 
Modelrangemanager node_model_ids_
 ConnBuilder factories, indexed by connruledict_ elements. More...
 
bool dict_miss_is_error_
 whether to throw exception on missed dictionary entries More...
 
bool model_defaults_modified_
 whether any model defaults have been modified More...
 

Friends

class Scheduler
 

Detailed Description

Main administrative interface to the network.

Class Network is responsible for

  1. Administration of Model objects.
  2. Administration of network Nodes.
  3. Administration of the simulation time.
  4. Update and scheduling during simulation.
  5. Memory cleanup at exit.
See also
Node
Model

Constructor & Destructor Documentation

nest::Network::Network ( SLIInterpreter i)
nest::Network::~Network ( )

Member Function Documentation

index nest::Network::add_node ( index  m,
long_t  n = 1 
)

Add a number of nodes to the network.

This function creates n Node objects of Model m and adds them to the Network at the current position.

Parameters
mvalid Model ID.
nNumber of Nodes to be created. Defaults to 1 if not specified.
Exceptions
nest::UnknownModelID

References nest::SparseNodeArray::add_local_node(), nest::Subnet::add_node(), nest::Modelrangemanager::add_range(), nest::SparseNodeArray::add_remote_node(), nest::Subnet::add_remote_node(), nest::Model::allocate(), assert(), current_, nest::Node::get_gid(), nest::SparseNodeArray::get_max_gid(), nest::Scheduler::get_n_gsd(), nest::SparseNodeArray::get_node_by_gid(), nest::Scheduler::get_num_rec_processes(), nest::Scheduler::get_num_sim_processes(), get_num_threads(), nest::Communicator::get_rank(), nest::SiblingContainer::get_thread_sibling_(), nest::Model::has_proxies(), nest::Scheduler::increment_n_gsd(), is_local_vp(), nest::Model::is_off_grid(), local_nodes_, SLIInterpreter::M_ERROR, SLIInterpreter::M_INFO, nest::SparseNodeArray::max_size(), message(), nest::mod(), nest::names::model, models_, nest::names::n, node_model_ids_, nest::SiblingContainer::num_thread_siblings_(), nest::Model::one_node_per_process(), nest::Model::potential_global_receiver(), nest::SiblingContainer::push_back(), nest::SiblingContainer::reserve(), nest::SparseNodeArray::reserve(), nest::Model::reserve_additional(), root_, scheduler_, nest::Node::set_gid_(), nest::Node::set_has_proxies(), nest::Node::set_local_receiver(), nest::Node::set_model_id(), nest::Scheduler::set_off_grid_communication(), nest::Node::set_thread(), nest::Node::set_vp(), siblingcontainer_model, suggest_rec_vp(), suggest_vp(), thread_to_vp(), nest::names::vp, and vp_to_thread().

Referenced by nest::AbstractLayer::create_layer(), nest::NestModule::Create_l_iFunction::execute(), and restore_nodes().

void nest::Network::calibrate_clock ( )
inline

Recalibrate scheduler clock.

References nest::Scheduler::calibrate_clock(), and scheduler_.

Referenced by nest::NestModule::init().

void nest::Network::clear_models_ ( bool  called_from_destructor = false)
private
void nest::Network::connect ( index  s,
Node target,
thread  target_thread,
index  syn,
double_t  d = NAN,
double_t  w = NAN 
)

Connect two nodes.

The source node is defined by its global ID. The target node is defined by the node. The connection is established on the thread/process that owns the target node.

The parameters delay and weight have the default value NAN. NAN is a special value in cmath, which describes double values that are not a number. If delay or weight is omitted in a connect call, NAN indicates this and weight/delay are set only, if they are valid.

Parameters
sGID of the sending Node.
targetPointer to target Node.
target_threadThread that hosts the target node.
synThe synapse model to use.
dDelay of the connection (in ms).
wWeight of the connection.

References nest::ConnectionManager::connect(), connection_manager_, nest::Node::get_gid(), get_node(), get_num_threads(), nest::Node::get_thread(), nest::Node::has_proxies(), nest::Node::is_proxy(), nest::Node::local_receiver(), nest::names::source, and nest::names::target_thread.

Referenced by nest::cg_connect(), nest::ConnectionCreator::connect_(), nest::ConnectionCreator::convergent_connect_(), divergent_connect(), nest::ConnectionCreator::divergent_connect_(), nest::NestModule::DataConnect_aFunction::execute(), nest::NestModule::Connect_i_i_lFunction::execute(), nest::NestModule::Connect_i_i_d_d_lFunction::execute(), nest::NestModule::Connect_i_i_D_lFunction::execute(), nest::NestModule::Connect_g_g_D_DFunction::execute(), and nest::ConnectionCreator::source_driven_connect_().

void nest::Network::connect ( index  s,
Node target,
thread  target_thread,
index  syn,
DictionaryDatum params,
double_t  d = NAN,
double_t  w = NAN 
)

Connect two nodes.

The source node is defined by its global ID. The target node is defined by the node. The connection is established on the thread/process that owns the target node.

The parameters delay and weight have the default value NAN. NAN is a special value in cmath, which describes double values that are not a number. If delay or weight is omitted in an connect call, NAN indicates this and weight/delay are set only, if they are valid.

Parameters
sGID of the sending Node.
targetPointer to target Node.
target_threadThread that hosts the target node.
synThe synapse model to use.
paramsparameter dict to configure the synapse
dDelay of the connection (in ms).
wWeight of the connection.

References nest::ConnectionManager::connect(), connection_manager_, nest::Node::get_gid(), get_node(), get_num_threads(), nest::Node::get_thread(), nest::Node::has_proxies(), nest::Node::is_proxy(), nest::Node::local_receiver(), nest::names::source, and nest::names::target_thread.

bool nest::Network::connect ( index  s,
index  r,
DictionaryDatum params,
index  syn 
)

Connect two nodes.

The source node is defined by its global ID. The target node is defined by the node. The connection is established on the thread/process that owns the target node.

Parameters
sGID of the sending Node.
targetpointer to target Node.
target_threadthread that hosts the target node
paramsparameter dict to configure the synapse
synThe synapse model to use.

References nest::ConnectionManager::connect(), connection_manager_, get_node(), get_num_threads(), nest::Node::get_thread(), nest::Node::has_proxies(), is_local_gid(), nest::Node::is_proxy(), nest::Node::local_receiver(), and nest::names::target_thread.

void nest::Network::connect ( ArrayDatum connectome)
inline

Connect from an array of dictionaries.

References nest::ConnectionManager::connect(), and connection_manager_.

void nest::Network::connect ( const GIDCollection sources,
const GIDCollection targets,
const DictionaryDatum conn_spec,
const DictionaryDatum syn_spec 
)
void nest::Network::convergent_connect ( const TokenArray  s,
index  r,
const TokenArray  weights,
const TokenArray  delays,
index  syn 
)
void nest::Network::convergent_connect ( const std::vector< index > &  s_id,
index  r,
const TokenArray weight,
const TokenArray delays,
index  syn 
)

Specialized version of convegent_connect called by random_convergent_connect threaded.

New and specialized variant of the convergent_connect() function, which takes a vector<Node*> for sources and relies on the fact that target is guaranteed to be on this thread.

References nest::ConnectionManager::connect(), connection_manager_, numerics::e, TokenArray::get(), nest::Node::get_gid(), get_node(), nest::Node::get_thread(), nest::Node::has_proxies(), nest::Node::is_proxy(), SLIInterpreter::M_WARNING, TypeMismatch::message(), nest::UnknownReceptorType::message(), nest::IllegalConnection::message(), message(), TokenArray::size(), nest::names::source, nest::names::target, and nest::names::target_thread.

index nest::Network::copy_model ( index  old_id,
std::string  new_name 
)

Copy an existing model and register it as a new model.

This function allows users to create their own, cloned models.

Parameters
old_idThe id of the existing model.
new_nameThe name of the new model.
Return values
Index,identifyingthe new Model object.
See also
copy_synapse_prototype()
Todo:
Not fully compatible with thread number changes and unregister_model() yet.

References nest::Model::allocate(), assert(), nest::Model::clone(), get_model(), get_model_id(), get_num_threads(), Dictionary::insert(), Dictionary::known(), modeldict_, models_, proxy_nodes_, and nest::Node::set_model_id().

Referenced by nest::NestModule::CopyModel_l_l_DFunction::execute().

int nest::Network::copy_synapse_prototype ( index  sc,
std::string  name 
)
inline
void nest::Network::destruct_nodes_ ( )
private
bool nest::Network::dict_miss_is_error ( ) const
inline
void nest::Network::divergent_connect ( index  s,
const TokenArray  r,
const TokenArray  weights,
const TokenArray  delays,
index  syn 
)
void nest::Network::divergent_connect ( index  s,
DictionaryDatum  d,
index  syn 
)
void nest::Network::ensure_valid_thread_local_ids ( )
inline

Ensure that all nodes in the network have valid thread-local IDs.

References nest::Scheduler::ensure_valid_thread_local_ids(), and scheduler_.

Referenced by nest::TargetIdentifierIndex::set_target().

int nest::Network::execute_sli_protected ( DictionaryDatum  state,
Name  cmd 
)
ArrayDatum nest::Network::get_connections ( DictionaryDatum  dict)
inline
DictionaryDatum nest::Network::get_connector_defaults ( index  sc)
inline
const modelrange & nest::Network::get_contiguous_gid_range ( index  gid) const
inline

Return the contiguous range of ids of nodes with the same model than the node with the given GID.

References nest::Modelrangemanager::get_range(), and node_model_ids_.

Subnet * nest::Network::get_cwn ( void  ) const
inline
const std::string & nest::Network::get_data_path ( ) const
inline

The path for files written by devices.

It may be the empty string (use current directory).

See also
get_data_prefix(), overwrite_files()

References data_path_.

Referenced by nest::RecordingDevice::build_filename_().

const std::string & nest::Network::get_data_prefix ( ) const
inline

The prefix for files written by devices.

The prefix must not contain any part of a path.

See also
get_data_dir(), overwrite_files()

References data_prefix_.

Referenced by nest::RecordingDevice::build_filename_().

int nest::Network::get_exitcode ( ) const
inline

Return the exitcode that would be returned to the calling shell if NEST would quit now.

References SLIInterpreter::baselookup(), getValue< long >(), and interpreter_.

librandom::RngPtr nest::Network::get_grng ( ) const
inline
delay nest::Network::get_max_delay ( ) const
inline
delay nest::Network::get_min_delay ( ) const
inline
Model * nest::Network::get_model ( index  m) const
inline
int nest::Network::get_model_id ( const char  name[]) const

Return the model id for a given model name.

References assert(), and models_.

Referenced by copy_model(), init_(), register_model(), and restore_nodes().

index nest::Network::get_model_id_of_gid ( index  gid)
inline
Model * nest::Network::get_model_of_gid ( index  gid)
inline

Return the Model for a given GID.

References get_model_id_of_gid(), and models_.

const Dictionary & nest::Network::get_modeldict ( )
inline
thread nest::Network::get_num_processes ( ) const
inline

Get number of processes.

References nest::Scheduler::get_num_processes(), and scheduler_.

thread nest::Network::get_num_rec_processes ( ) const
inline

Get number of recording processes.

References nest::Scheduler::get_num_rec_processes(), and scheduler_.

thread nest::Network::get_num_sim_processes ( ) const
inline

Get number of simulating processes.

References nest::Scheduler::get_num_sim_processes(), and scheduler_.

thread nest::Network::get_num_threads ( ) const
inline

Get number of threads.

This function returns the total number of threads per process.

References nest::Scheduler::get_num_threads(), and scheduler_.

Referenced by add_node(), nest::ConnBuilder::ConnBuilder(), connect(), copy_model(), nest::NestModule::get_num_threads(), init_(), register_model(), and unregister_model().

bool nest::Network::get_off_grid_communication ( ) const
inline

return current communication style.

A result of true means off_grid, false means on_grid communication.

References nest::Scheduler::get_off_grid_communication(), and scheduler_.

Time nest::Network::get_previous_slice_origin ( ) const
inline

Get the time at the beginning of the previous time slice.

References nest::Scheduler::get_previous_slice_origin(), and scheduler_.

librandom::RngPtr nest::Network::get_rng ( thread  thrd = 0) const
inline

Get random number client of a thread.

Defaults to thread 0 to allow use in non-threaded context. One may consider to introduce an additional RNG just for the non-threaded context.

References nest::Scheduler::get_rng(), and scheduler_.

Referenced by nest::ConnectionCreator::connect_to_target_(), nest::ConnectionCreator::convergent_connect_(), nest::NestModule::GetVpRngFunction::execute(), random_convergent_connect(), nest::Quantal_StpConnection< targetidentifierT >::send(), and nest::ConnectionCreator::source_driven_connect_().

Subnet * nest::Network::get_root ( ) const
inline

return root subnet.

References root_.

bool nest::Network::get_simulated ( ) const
inline
Time const & nest::Network::get_slice_origin ( ) const
inline

Get the time at the beginning of the current time slice.

References nest::Scheduler::get_slice_origin(), and scheduler_.

Referenced by send().

DictionaryDatum nest::Network::get_status ( index  idx)
DictionaryDatum nest::Network::get_synapse_status ( index  gid,
index  syn,
port  p,
thread  tid 
)
inline
const Dictionary & nest::Network::get_synapsedict ( ) const
inline
int nest::Network::get_thread_id ( ) const
inline

Gets ID of local thread.

Returns thread ID if OPENMP is installed and zero otherwise.

Referenced by nest::ConnectionCreator::connect_(), random_convergent_connect(), and nest::ConnectionCreator::target_driven_connect_().

Time const nest::Network::get_time ( ) const
inline

Get the current simulation time.

Defined only while no simulation in progress.

References nest::Scheduler::get_time(), and scheduler_.

void nest::Network::go_to ( index  n)

Change current working node.

The specified node must exist and be a subnet.

Exceptions
nest::IllegalOperationTarget is no subnet.

References current_, get_node(), and nest::names::target.

Referenced by nest::AbstractLayer::create_layer(), nest::NestModule::ChangeSubnet_iFunction::execute(), and restore_nodes().

bool nest::Network::has_user_models ( ) const
inline

Does the network contain copies of models created using CopyModel?

References models_, and pristine_models_.

Referenced by nest::DynamicLoaderModule::UnloadModuleFunction::execute().

void nest::Network::init_ ( )
private
void nest::Network::init_state ( index  GID)

Set the state (observable dynamic variables) of a node to model defaults.

See also
Node::init_state()

References get_node(), nest::Node::init_state(), and nest::names::n.

bool nest::Network::is_local_gid ( index  gid) const
inline
bool nest::Network::is_local_node ( Node n) const
inline

Return true, if the given Node is on the local machine.

References nest::Node::is_proxy().

bool nest::Network::is_local_vp ( thread  t) const
inline

Return true, if the given VP is on the local machine.

References nest::Scheduler::is_local_vp(), and scheduler_.

Referenced by add_node().

void nest::Network::memory_info ( )
void nest::Network::message ( int  level,
const std::string &  loc,
const std::string &  msg 
)

References message().

bool nest::Network::model_defaults_modified ( ) const
inline
bool nest::Network::model_in_use ( index  i)

Check, if there are instances of a given model.

Parameters
iindex of the model to check for
Returns
true, if model is instantiated at least once.

References nest::Modelrangemanager::model_in_use(), and node_model_ids_.

Referenced by try_unregister_model(), and unregister_model().

bool nest::Network::overwrite_files ( ) const
inline

Indicate if existing data files should be overwritten.

Returns
true if existing data files should be overwritten by devices. Default: false.

References overwrite_files_.

Referenced by nest::RecordingDevice::calibrate().

void nest::Network::print ( index  p,
int  depth 
)
void nest::Network::publish_music_in_ports_ ( )

Publish all MUSIC input ports that were registered using Network::register_music_event_in_proxy().

References music_in_portmap_.

bool nest::Network::quit_by_error ( ) const
inline

Return true if NEST will be quit because of an error, false otherwise.

References SLIInterpreter::baselookup(), getValue< bool >(), and interpreter_.

void nest::Network::random_convergent_connect ( const TokenArray  s,
index  t,
index  n,
const TokenArray  w,
const TokenArray  d,
bool  allow_multapses,
bool  allow_autapses,
index  syn 
)
void nest::Network::random_convergent_connect ( TokenArray  s,
TokenArray  t,
TokenArray  n,
TokenArray  w,
TokenArray  d,
bool  allow_multapses,
bool  allow_autapses,
index  syn 
)
void nest::Network::random_divergent_connect ( index  s,
const TokenArray  r,
index  n,
const TokenArray  w,
const TokenArray  d,
bool  allow_multapses,
bool  allow_autapses,
index  syn 
)
size_t nest::Network::read_toggle ( ) const
inline

Return 1 - write_toggle().

This is useful for buffers that need to be read alternatingly by slice. The value is given by 1-write_toggle().

See also
write_toggle

References write_toggle().

void nest::Network::register_basis_model ( Model m,
bool  private_model = false 
)

Registers a fundamental model for use with the network.

Parameters
mModel object.
private_modelIf true, model is not entered in modeldict.
Returns
void
Note
The Network calls the Model object's destructor at exit.
See also
register_model, unregister_model, register_user_model

References nest::Model::get_name(), Dictionary::known(), modeldict_, and pristine_models_.

Referenced by Network().

template<typename ConnBuilder >
void nest::Network::register_conn_builder ( const std::string &  name)

Add a connectivity rule, i.e.

the respective ConnBuilderFactory.

References assert(), connbuilder_factories_, connruledict_, Dictionary::insert(), and Dictionary::known().

Referenced by nest::NestModule::init().

index nest::Network::register_model ( Model m,
bool  private_model = false 
)

Register a built-in model for use with the network.

Also enters the model in modeldict, unless private_model is true.

Parameters
mModel object.
private_modelIf true, model is not entered in modeldict.
Returns
Model ID assigned by network
Note
The Network calls the Model object's destructor at exit.
See also
unregister_model, register_user_model

References nest::Model::allocate(), assert(), nest::Model::clone(), get_model_id(), nest::Model::get_name(), get_num_threads(), Dictionary::insert(), Dictionary::known(), modeldict_, models_, pristine_models_, proxy_nodes_, nest::Model::set_model_id(), nest::Node::set_model_id(), and nest::Model::set_type_id().

Referenced by nest::register_model(), and nest::register_preconf_model().

void nest::Network::register_music_event_in_proxy ( std::string  portname,
int  channel,
nest::Node mp 
)

Register a node (of type music_input_proxy) with a given MUSIC port (portname) and a specific channel.

The proxy will be notified, if a MUSIC event is being received on the respective channel and port.

References music_in_portlist_, music_in_portmap_, and nest::MusicEventHandler::register_channel().

void nest::Network::register_music_in_port ( std::string  portname)

Register a MUSIC input port (portname) with the port list.

This will increment the counter of the respective entry in the music_in_portlist.

References music_in_portlist_.

Referenced by nest::music_event_in_proxy::music_event_in_proxy().

synindex nest::Network::register_synapse_prototype ( ConnectorModel cf)
inline

Register a synapse prototype at the connection manager.

References connection_manager_, and nest::ConnectionManager::register_synapse_prototype().

Referenced by nest::register_connection_model().

void nest::Network::reset ( )

Reset deletes all nodes and reallocates all memory pools for nodes.

References clear_models_(), connection_manager_, destruct_nodes_(), init_(), pristine_models_, nest::ConnectionManager::reset(), nest::Scheduler::reset(), and scheduler_.

Referenced by reset_kernel().

void nest::Network::reset_kernel ( )
void nest::Network::reset_network ( )
void nest::Network::restore_nodes ( ArrayDatum node_list)

Restore nodes from an array of status dictionaries.

The following entries must be present in each dictionary: /model - with the name or index of a neuron mode.

The following entries are optional: /parent - the node is created in the parent subnet

Restore nodes uses the current working node as root. Thus, all GIDs in the status dictionaties are offset by the GID of the current working node. This allows entire subnetworks to be copied.

References add_node(), TokenArray::begin(), current_, TokenArray::end(), get_cwn(), get_model_id(), get_node(), nest::names::global_id, go_to(), nest::names::model, nest::names::parent, nest::Node::set_status_base(), and size().

Referenced by nest::NestModule::RestoreNodes_aFunction::execute().

void nest::Network::resume ( )

Resume the simulation after it was terminated.

References nest::Scheduler::resume(), and scheduler_.

Referenced by nest::NestModule::ResumeSimulationFunction::execute().

template<class EventT >
void nest::Network::send ( Node source,
EventT &  e,
const long_t  lag = 0 
)
inline

Standard routine for sending events.

This method decides if the event has to be delivered locally or globally. It exists to keep a clean and unitary interface for the event sending mechanism.

Note
Only specialization for SpikeEvent does remote sending. Specialized for DSSpikeEvent to avoid that these events are sent to remote processes.
See also
send_local()

References assert(), connection_manager_, nest::Node::get_gid(), get_slice_origin(), nest::Node::get_thread(), nest::Node::has_proxies(), and nest::ConnectionManager::send().

Referenced by nest::iaf_psc_exp_multisynapse::update(), nest::iaf_psc_alpha_multisynapse::update(), nest::parrot_neuron_ps::update(), nest::parrot_neuron::update(), nest::aeif_cond_alpha_multisynapse::update(), nest::iaf_psc_alpha::update(), nest::ht_neuron::update(), and nest::Multimeter::update().

template<>
void nest::Network::send ( Node source,
SpikeEvent e,
const long_t  lag 
)
inline

References numerics::e, and nest::names::source.

template<>
void nest::Network::send ( Node source,
DSSpikeEvent e,
const long_t  lag 
)
inline
void nest::Network::send_local ( thread  t,
Node source,
Event e 
)
inline

Send event e to all targets of node source on thread t.

References connection_manager_, nest::Node::get_gid(), nest::ConnectionManager::send(), and nest::Event::set_sender_gid().

void nest::Network::send_to_node ( Event e)
inline

Send event e directly to its target node.

This should be used only where necessary, e.g. if a node wants to reply to a *RequestEvent immediately.

References numerics::e.

void nest::Network::set_connector_defaults ( index  sc,
DictionaryDatum d 
)
inline
void nest::Network::set_data_path_prefix_ ( const DictionaryDatum d)
private

Helper function to set device data path and prefix.

References data_path_, data_prefix_, SLIInterpreter::M_ERROR, and message().

Referenced by init_(), and set_status().

void nest::Network::set_model_defaults_modified ( )
inline
void nest::Network::set_music_in_port_acceptable_latency ( std::string  portname,
double_t  latency 
)

Set the acceptable latency (latency) for a music input port (portname).

References music_in_portlist_.

Referenced by nest::NestModule::SetAcceptableLatencyFunction::execute().

void nest::Network::set_music_in_port_max_buffered ( std::string  portname,
int_t  maxbuffered 
)
void nest::Network::set_num_rec_processes ( int  nrp)
inline
void nest::Network::set_status ( index  gid,
const DictionaryDatum d 
)

Set properties of a Node.

The specified node must exist.

Exceptions
nest::UnknownNodeTarget does not exist in the network.
nest::UnaccessedDictionaryEntryNon-proxy target did not read dict entry.
TypeMismatchArray is not a flat & homogeneous array of integers.

References assert(), nest::names::d, dict_miss_is_error_, nest::SparseNodeArray::get_node_by_gid(), nest::Node::get_thread_sibling_(), local_nodes_, nest::Node::num_thread_siblings_(), overwrite_files_, scheduler_, set_data_path_prefix_(), nest::Scheduler::set_status(), set_status_single_node_(), and nest::names::target.

Referenced by nest::NestModule::SetStatus_idFunction::execute().

void nest::Network::set_status_single_node_ ( Node target,
const DictionaryDatum d,
bool  clear_flags = true 
)
private

Helper function to set properties on single node.

Parameters
nodeto set properties for
dictionarycontaining properties
iftrue (default), access flags are called before each call so Node::set_status_()
Exceptions
UnaccessedDictionaryEntry

References dict_miss_is_error(), nest::Node::is_proxy(), SLIInterpreter::M_WARNING, message(), and nest::Node::set_status_base().

Referenced by set_status().

void nest::Network::set_synapse_status ( index  gid,
index  syn,
port  p,
thread  tid,
DictionaryDatum d 
)
inline
void nest::Network::simulate ( Time const &  t)
index nest::Network::size ( void  ) const
inline

Return total number of network nodes.

The size also includes all Subnet objects.

References nest::SparseNodeArray::get_max_gid(), and local_nodes_.

Referenced by get_status(), and restore_nodes().

void nest::Network::subnet_connect ( Subnet ,
Subnet ,
int  ,
index  syn 
)
int nest::Network::suggest_rec_vp ( index  gid) const
inline

Suggest a VP for a given global recording node ID.

References scheduler_, and nest::Scheduler::suggest_rec_vp().

Referenced by add_node().

int nest::Network::suggest_vp ( index  gid) const
inline

Suggest a VP for a given global node ID.

References scheduler_, and nest::Scheduler::suggest_vp().

Referenced by add_node().

void nest::Network::terminate ( )
inline

Terminate the simulation after the time-slice is finished.

References scheduler_, and nest::Scheduler::terminate().

Node * nest::Network::thread_lid_to_node ( thread  t,
targetindex  thread_local_id 
) const
inline
thread nest::Network::thread_to_vp ( thread  t) const
inline

Convert a given thread ID to the corresponding VP ID.

References scheduler_, and nest::Scheduler::thread_to_vp().

Referenced by add_node(), and init_().

void nest::Network::trigger_update_weight ( const long_t  vt_gid,
const vector< spikecounter > &  dopa_spikes,
const double_t  t_trig 
)
inline

Triggered by volume transmitter in update.

Triggeres updates for all connectors of dopamine synapses that are registered with the volume transmitter with gid vt_gid.

References connection_manager_, and nest::ConnectionManager::trigger_update_weight().

void nest::Network::try_unregister_model ( index  m_id)

Try unregistering model prototype.

Throws ModelInUseException, if not possible, does not unregister.

References get_model(), nest::Model::get_name(), and model_in_use().

void nest::Network::unregister_model ( index  m_id)
void nest::Network::unregister_music_in_port ( std::string  portname)

Unregister a MUSIC input port (portname) from the port list.

This will decrement the counter of the respective entry in the music_in_portlist and remove the entry if the counter is 0 after decrementing it.

References music_in_portlist_.

void nest::Network::update_music_event_handlers_ ( Time const &  origin,
const long_t  from,
const long_t  to 
)

Call update() for each of the registered MUSIC event handlers to deliver all queued events to the target music_in_proxies.

References music_in_portmap_.

thread nest::Network::vp_to_thread ( thread  vp) const
inline

Convert a given VP ID to the corresponding thread ID.

References scheduler_, and nest::Scheduler::vp_to_thread().

Referenced by add_node().

size_t nest::Network::write_toggle ( ) const
inline

Return 0 for even, 1 for odd time slices.

This is useful for buffers that need to be written alternatingly by time slice. The value is given by Scheduler::get_slice_() % 2.

See also
read_toggle

References nest::Scheduler::get_slice(), and scheduler_.

Referenced by read_toggle().

Friends And Related Function Documentation

friend class Scheduler
friend

Member Data Documentation

std::vector<GenericConnBuilderFactory*> nest::Network::connbuilder_factories_
private

Referenced by connect(), and register_conn_builder().

ConnectionManager nest::Network::connection_manager_
private
Dictionary* nest::Network::connruledict_
private

Dictionary for connection rules.

Referenced by connect(), Network(), and register_conn_builder().

Subnet* nest::Network::current_
private

Current working node (for insertion).

Referenced by add_node(), get_cwn(), go_to(), init_(), and restore_nodes().

std::string nest::Network::data_path_
private

Path for all files written by devices.

Referenced by get_data_path(), get_status(), reset_kernel(), and set_data_path_prefix_().

std::string nest::Network::data_prefix_
private

Prefix for all files written by devices.

Referenced by get_data_prefix(), get_status(), reset_kernel(), and set_data_path_prefix_().

bool nest::Network::dict_miss_is_error_
private

whether to throw exception on missed dictionary entries

Referenced by dict_miss_is_error(), get_status(), reset_kernel(), and set_status().

std::vector<Node*> nest::Network::dummy_spike_sources_
private

Placeholders for spiking remote nodes, one per thread.

Referenced by destruct_nodes_(), and init_().

SLIInterpreter& nest::Network::interpreter_
private
SparseNodeArray nest::Network::local_nodes_
private

The network as sparse array of local nodes.

Referenced by add_node(), destruct_nodes_(), get_node(), get_status(), get_thread_siblings(), init_(), is_local_gid(), reset_network(), set_status(), and size().

bool nest::Network::model_defaults_modified_
private

whether any model defaults have been modified

Referenced by clear_models_(), model_defaults_modified(), and set_model_defaults_modified().

Dictionary* nest::Network::modeldict_
private
std::vector<Model *> nest::Network::models_
private
std::map< std::string, MusicPortData > nest::Network::music_in_portlist_

The mapping between MUSIC input ports identified by portname and the corresponding port variables and parameters.

See also
register_music_in_port()
unregister_music_in_port()

Referenced by init_(), register_music_event_in_proxy(), register_music_in_port(), set_music_in_port_acceptable_latency(), set_music_in_port_max_buffered(), and unregister_music_in_port().

std::map< std::string, MusicEventHandler > nest::Network::music_in_portmap_

The mapping between MUSIC input ports identified by portname and the corresponding MUSIC event handler.

Referenced by publish_music_in_ports_(), register_music_event_in_proxy(), and update_music_event_handlers_().

Modelrangemanager nest::Network::node_model_ids_
private

ConnBuilder factories, indexed by connruledict_ elements.

Records the model id of each neuron in the network

Referenced by add_node(), destruct_nodes_(), get_contiguous_gid_range(), get_model_id_of_gid(), get_node(), init_(), and model_in_use().

bool nest::Network::overwrite_files_
private

If true, overwrite existing data files.

Referenced by get_status(), overwrite_files(), reset_kernel(), and set_status().

std::vector< std::pair<Model *, bool> > nest::Network::pristine_models_
private

The list of clean models.

The first component of the pair is a pointer to the actual Model, the second is a flag indicating if the model is private. Private models are not entered into the modeldict.

Referenced by has_user_models(), init_(), register_basis_model(), register_model(), reset(), unregister_model(), and ~Network().

std::vector< std::vector<Node*> > nest::Network::proxy_nodes_
private

Placeholders for remote nodes, one per thread.

Referenced by copy_model(), destruct_nodes_(), get_node(), init_(), register_model(), and unregister_model().

Subnet* nest::Network::root_
private

Root node.

Referenced by add_node(), get_root(), get_status(), and init_().

Scheduler nest::Network::scheduler_
private
Model* nest::Network::siblingcontainer_model
private

The model for the SiblingContainer class.

Referenced by add_node(), init_(), and Network().

Dictionary* nest::Network::synapsedict_
private

Dictionary for synapse models.

Referenced by get_synapsedict(), and Network().


The documentation for this class was generated from the following files: