37 #include "compose.hpp"
69 class SiblingContainer;
72 class GenericConnBuilderFactory;
219 template <
typename ConnBuilder>
439 template <
class EventT>
692 void message(
int level,
const char from[],
const char text[]);
693 void message(
int level,
const std::string& loc,
const std::string& msg);
880 t = systemdict->lookup(
Name(
"errordict"));
1079 template <
class EventT>
1084 e.set_sender(source);
1096 e.set_stamp(get_slice_origin() +
Time::step(lag + 1));
1100 if (
source.has_proxies())
1102 if (
source.is_off_grid() )
1103 scheduler_.send_offgrid_remote(t,
e, lag);
1105 scheduler_.send_remote(t,
e, lag);
1115 e.set_stamp(get_slice_origin() +
Time::step(lag + 1));
1251 class ModelComp :
public std::binary_function<int, int, bool>
1267 return omp_get_thread_num();
size_t index
Unsigned long type for enumerations.
Definition: nest.h:109
Subnet * current_
Current working node (for insertion).
Definition: network.h:812
SLIInterpreter & interpreter_
Definition: network.h:806
Definition: modelrangemanager.h:32
std::vector< std::pair< Model *, bool > > pristine_models_
The list of clean models.
Definition: network.h:854
const Dictionary & get_synapsedict() const
Return the synapse dictionary.
Definition: network.h:1230
bool dict_miss_is_error_
whether to throw exception on missed dictionary entries
Definition: network.h:864
SiblingContainer class.
Definition: sibling_container.h:46
double_t weight
Weight of a connection.
Definition: nest.h:170
void send(thread t, index sgid, Event &e)
int int_t
Integer number with at least 16 bit.
Definition: nest.h:95
ConnectionManager connection_manager_
Definition: network.h:809
std::map< std::string, MusicPortData > music_in_portlist_
The mapping between MUSIC input ports identified by portname and the corresponding port variables and...
Definition: network.h:750
Base class for all subnet nodes.
Definition: subnet.h:67
MusicPortData(size_t n, double_t latency, int_t m)
Definition: network.h:734
std::vector< Node * > dummy_spike_sources_
Placeholders for spiking remote nodes, one per thread.
Definition: network.h:858
void random_divergent_connect(index s, const TokenArray r, index n, const TokenArray w, const TokenArray d, bool, bool, index syn)
Definition: network.cpp:1243
void set_status(index, const DictionaryDatum &)
Set properties of a Node.
Definition: network.cpp:704
bool has_user_models() const
Does the network contain copies of models created using CopyModel?
Definition: network.h:1237
index get_gid() const
Return global Network ID.
Definition: node.h:753
Data structure to hold variables and parameters associated with a port.
Definition: network.h:733
synindex register_synapse_prototype(ConnectorModel *cf)
Register a synapse type.
bool is_local_vp(thread) const
Return true, if the given VP is on the local machine.
Definition: network.h:1026
thread get_num_processes() const
Return the number of processes used during simulation.
Definition: scheduler.h:623
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
bool get_simulated() const
See Scheduler::get_simulated()
Definition: network.h:1056
void set_num_rec_processes(int nrp, bool called_by_reset=false)
Set number of recording processes, switches NEST to global spike detection mode.
thread vp_to_thread(thread vp) const
Definition: scheduler.h:690
void go_to(index)
Change current working node.
Definition: network.cpp:611
synindex register_synapse_prototype(ConnectorModel *cf)
Register a synapse prototype at the connection manager.
Definition: network.h:942
"Callback request event" for use in Device.
Definition: event.h:374
index get_model_id_of_gid(index)
Return the Model ID for a given GID.
Definition: network.h:1184
Time const get_time() const
Precise time of simulation.
Definition: scheduler.h:610
thread get_num_threads() const
Return the number of threads used during simulation.
Definition: scheduler.h:617
void print(index, int)
Definition: network.cpp:695
void unregister_music_in_port(std::string portname)
Unregister a MUSIC input port (portname) from the port list.
Definition: network.cpp:1856
thread get_num_rec_processes() const
Get number of recording processes.
Definition: network.h:996
const modelrange & get_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...
Definition: network.h:1193
int execute_sli_protected(DictionaryDatum, Name)
Execute a SLI command in the neuron's namespace.
Definition: network.cpp:1819
void send(Node &source, EventT &e, const long_t lag=0)
Standard routine for sending events.
Definition: network.h:1081
size_t get_slice() const
Get slice number.
Definition: scheduler.h:817
size_t write_toggle() const
Return 0 for even, 1 for odd time slices.
Definition: network.h:1144
thread suggest_rec_vp(index) const
Suggest a VP for a given global recording node ID.
Definition: network.h:1038
Encapsulates information which is sent between Nodes.
Definition: event.h:73
void send_to_node(Event &e)
Send event e directly to its target node.
Definition: network.h:1132
const std::string & get_data_path() const
The path for files written by devices.
Definition: network.h:1199
void terminate()
Definition: scheduler.h:823
Subnet * get_cwn() const
current working node.
Definition: network.h:978
Definition: nest_time.h:230
void init_state(index)
Set the state (observable dynamic variables) of a node to model defaults.
Definition: network.cpp:602
void set_music_in_port_max_buffered(std::string portname, int_t maxbuffered)
Definition: network.cpp:1896
const modelrange & get_range(index gid) const
Definition: modelrangemanager.cpp:99
const Name weights("weights")
Connection parameters.
Definition: nest_names.h:348
void set_sender_gid(index)
Change GID of sending Node.
Definition: event.h:720
DictionaryDatum get_synapse_status(index gid, synindex syn_id, port p, thread tid)
void message(int level, const char from[], const char text[])
Display a message.
Definition: network.cpp:1698
void divergent_connect(index s, const TokenArray r, const TokenArray weights, const TokenArray delays, index syn)
Definition: network.cpp:988
Provide sparse representation of local nodes.
Definition: sparse_node_array.h:52
Represent strings by ints to facilitate fast comparison.
Definition: name.h:53
const Dictionary & get_modeldict()
Return a reference to the model dictionary.
Definition: network.h:1223
SparseNodeArray local_nodes_
The network as sparse array of local nodes.
Definition: network.h:807
virtual bool has_proxies() const
Returns true if the node has proxies on remote threads.
Definition: node.h:711
static delay get_min_delay()
Return minimal connection delay.
Definition: scheduler.h:805
Model * siblingcontainer_model
The model for the SiblingContainer class.
Definition: network.h:842
librandom::RngPtr get_grng() const
Get global random number client.
Definition: network.h:1163
bool overwrite_files_
If true, overwrite existing data files.
Definition: network.h:846
void send_local(thread t, Node &source, Event &e)
Send event e to all targets of node source on thread t.
Definition: network.h:1124
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 tar...
Definition: network.cpp:1913
Definition: network.h:1251
size_t read_toggle() const
Return 1 - write_toggle().
Definition: network.h:1150
synindex copy_synapse_prototype(synindex old_id, std::string new_name)
thread get_num_processes() const
Get number of processes.
Definition: network.h:990
delay get_max_delay() const
Return maximal connection delay.
Definition: network.h:1068
Definition: tokenarray.h:62
thread suggest_vp(index) const
Suggest a VP for a given global node ID.
Definition: network.h:1032
const Name a("a")
Specific to Brette & Gerstner 2005 (aeif_cond-*)
Definition: nest_names.h:41
thread vp_to_thread(thread vp) const
Convert a given VP ID to the corresponding thread ID.
Definition: network.h:1044
bool quit_by_error() const
Return true if NEST will be quit because of an error, false otherwise.
Definition: network.h:876
std::map< std::string, MusicEventHandler > music_in_portmap_
The mapping between MUSIC input ports identified by portname and the corresponding MUSIC event handle...
Definition: network.h:756
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.
Definition: network.h:1074
void connect(index s, Node *target, thread target_thread, index syn, double_t d=NAN, double_t w=NAN)
Connect two nodes.
Definition: network.cpp:867
void connect(Node &s, Node &r, index s_gid, thread tid, index syn, double_t d=NAN, double_t w=NAN)
Connect is used to establish a connection between a sender and receiving node.
Time const & get_slice_origin() const
Time at beginning of current slice.
Definition: scheduler.h:598
index get_max_gid() const
Return largest GID in global network.
Definition: sparse_node_array.h:168
Subnet * root_
Root node.
Definition: network.h:811
Dictionary * connruledict_
Dictionary for connection rules.
Definition: network.h:840
void subnet_connect(Subnet &, Subnet &, int, index syn)
void register_conn_builder(const std::string &name)
Add a connectivity rule, i.e.
Definition: network_impl.h:31
const Name delays("delays")
Connection parameters.
Definition: nest_names.h:93
int get_exitcode() const
Return the exitcode that would be returned to the calling shell if NEST would quit now...
Definition: network.h:886
~Network()
Definition: network.cpp:95
ArrayDatum get_connections(DictionaryDatum dict)
Definition: network.h:924
A class that associates names and tokens.
Definition: dict.h:45
size_t n_input_proxies
Definition: network.h:738
const Name w("w")
Specific to Brette & Gerstner 2005 (aeif_cond-*)
Definition: nest_names.h:343
thread get_num_rec_processes() const
Definition: scheduler.h:629
void set_model_defaults_modified()
Definition: network.h:778
Time get_previous_slice_origin() const
Get the time at the beginning of the previous time slice.
Definition: network.h:960
void terminate()
Terminate the simulation after the time-slice is finished.
Definition: network.h:870
void trigger_update_weight(const long_t vt_gid, const vector< spikecounter > &dopa_spikes, const double_t t_trig)
Manages the available connection prototypes and connections.
Definition: connection_manager.h:49
std::vector< GenericConnBuilderFactory * > connbuilder_factories_
Definition: network.h:860
int_t max_buffered
Definition: network.h:741
Definition: nest_time.h:130
void set_synapse_status(index gid, synindex syn_id, port p, thread tid, const DictionaryDatum &d)
bool get_off_grid_communication() const
return current communication style.
Definition: scheduler.h:728
int get_thread_id() const
Gets ID of local thread.
Definition: network.h:1264
unsigned short targetindex
Unsigned short type for compact target representation.
Definition: nest.h:123
ModelComp(const vector< Model * > &nmodels)
Definition: network.h:1256
Exception to be thrown if a model with the the specified ID does not exist.
Definition: exceptions.h:109
Subnet * get_root() const
return root subnet.
Definition: network.h:972
Time const get_time() const
Get the current simulation time.
Definition: network.h:966
void set_num_rec_processes(int nrp)
Set number of recording processes.
Definition: network.h:1008
bool getValue< bool >(const Token &t)
Definition: tokenutils.cc:124
std::string data_prefix_
Prefix for all files written by devices.
Definition: network.h:845
void ensure_valid_thread_local_ids()
Ensure that all nodes in the network have valid thread-local IDs.
Definition: network.h:679
void set_synapse_status(index gid, index syn, port p, thread tid, DictionaryDatum &d)
Definition: network.h:918
Definition: gid_collection.h:37
void set_connector_defaults(index sc, DictionaryDatum &d)
Definition: network.h:930
const std::string & get_data_prefix() const
The prefix for files written by devices.
Definition: network.h:1205
std::vector< std::vector< Node * > > proxy_nodes_
Placeholders for remote nodes, one per thread.
Definition: network.h:857
bool is_in_range(index gid) const
Definition: modelrangemanager.h:37
const Name source("source")
Connection parameters.
Definition: nest_names.h:260
void random_convergent_connect(const TokenArray s, index t, index n, const TokenArray w, const TokenArray d, bool, bool, index syn)
Definition: network.cpp:1479
thread get_num_sim_processes() const
Get number of simulating processes.
Definition: network.h:1002
const std::vector< Model * > & models
Definition: network.h:1253
thread suggest_vp(index gid) const
Return a thread number for a given global node id.
Definition: scheduler.h:678
void init_()
Initialize the network data structures.
Definition: network.cpp:107
const Name target("target")
Connection parameters.
Definition: nest_names.h:282
Dictionary * synapsedict_
Dictionary for synapse models.
Definition: network.h:822
Base class for all Models.
Definition: model.h:48
void resume()
Resume the simulation after it was terminated.
Definition: network.cpp:657
librandom::RngPtr get_rng(thread thrd=0) const
Get random number client of a thread.
Definition: network.h:1157
void ensure_valid_thread_local_ids()
Ensure that all nodes in the network have valid thread-local IDs.
Definition: scheduler.h:342
thread get_num_threads() const
Get number of threads.
Definition: network.h:984
index copy_model(index old_id, std::string new_name)
Copy an existing model and register it as a new model.
Definition: network.cpp:1708
Dictionary * modeldict_
Dictionary for models.
Definition: network.h:830
Definition: interpret.h:69
virtual bool is_proxy() const
Returns true if the node is a proxy node.
Definition: node.h:741
Model * get_model_of_gid(index)
Return the Model for a given GID.
Definition: network.h:1178
Node * get_node(index, thread thr=0)
Return pointer of the specified Node.
Definition: network.cpp:619
librandom::RngPtr get_grng() const
Return pointer to global random number generator.
Definition: scheduler.h:741
void convergent_connect(const TokenArray s, index r, const TokenArray weights, const TokenArray delays, index syn)
Definition: network.cpp:1300
const Name vp("vp")
Node parameter.
Definition: nest_names.h:341
Main administrative interface to the network.
Definition: network.h:135
long_t get_model_id(index gid)
Definition: modelrangemanager.cpp:53
thread thread_to_vp(thread t) const
Definition: scheduler.h:703
bool is_local_vp(thread) const
Return true if the thread is on the local machine, false if not.
Definition: scheduler.h:672
const Name thread_local_id("thread_local_id")
Thead-local ID of node, see Kunkel et al 2014, Sec 3.3.2.
Definition: nest_names.h:310
Scheduler scheduler_
Definition: network.h:808
void set_prototype_status(synindex syn_id, const DictionaryDatum &d)
lockPTR< Network > NetPtr
Functor to compare Models by their name.
Definition: network.h:1248
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
void set_music_in_port_acceptable_latency(std::string portname, double_t latency)
Set the acceptable latency (latency) for a music input port (portname).
Definition: network.cpp:1886
const SiblingContainer * get_thread_siblings(index n) const
Return the Subnet that contains the thread siblings.
Definition: network.cpp:636
std::string data_path_
Path for all files written by devices.
Definition: network.h:844
void unregister_model(index m_id)
Unregister a previously registered model.
Definition: network.cpp:1779
ArrayDatum get_connections(DictionaryDatum params) const
Return connections between pairs of neurons.
DictionaryDatum get_synapse_status(index gid, index syn, port p, thread tid)
Definition: network.h:912
bool operator()(int a, int b)
Definition: network.h:1257
Network(SLIInterpreter &)
Definition: network.cpp:55
librandom::RngPtr get_rng(const thread) const
Return pointer to random number generator of the specified thread.
Definition: scheduler.h:734
double double_t
Double precision floating point numbers.
Definition: nest.h:93
Time get_previous_slice_origin() const
Time at beginning of previous slice.
Definition: scheduler.h:604
bool model_defaults_modified_
whether any model defaults have been modified
Definition: network.h:866
int copy_synapse_prototype(index sc, std::string)
Copy an existing synapse type.
Definition: network.h:948
const Name b("b")
Specific to Brette & Gerstner 2005 (aeif_cond-*)
Definition: nest_names.h:58
const Token & baselookup(const Name &n) const
Lookup a name searching only the bottom level dictionary.
Definition: interpret.cc:333
void destruct_nodes_()
Definition: network.cpp:192
void clear_models_(bool called_from_destructor=false)
Definition: network.cpp:214
Definition: modelrange.h:30
bool get_off_grid_communication() const
return current communication style.
Definition: network.h:1217
index add_node(index m, long_t n=1)
Add a number of nodes to the network.
Definition: network.cpp:333
const Name target_thread("target_thread")
Connection parameters.
Definition: nest_names.h:283
thread thread_to_vp(thread t) const
Convert a given thread ID to the corresponding VP ID.
Definition: network.h:1050
static delay get_max_delay()
Return maximal connection delay.
Definition: scheduler.h:811
void reset()
Reset deletes all nodes and reallocates all memory pools for nodes.
Definition: network.cpp:233
DictionaryDatum get_connector_defaults(index sc)
Definition: network.h:936
unsigned char synindex
Unsigned char type for enumerations of synapse types.
Definition: nest.h:115
DictionaryDatum get_prototype_status(synindex syn_id) const
thread get_thread() const
Retrieve the number of the thread to which the node is assigned.
Definition: node.h:825
void calibrate_clock()
Calibrate clock after resolution change.
Definition: scheduler.h:747
const Name n("n")
Number of synaptic release sites (int >=0) (Tsodyks2_connection)
Definition: nest_names.h:202
long_t delay
Delay of a connection.
Definition: nest.h:178
void calibrate_clock()
Recalibrate scheduler clock.
Definition: network.h:1138
Default types used by the NEST kernel.
std::vector< Model * > models_
The list of available models.
Definition: network.h:856
void register_music_in_port(std::string portname)
Register a MUSIC input port (portname) with the port list.
Definition: network.cpp:1846
Event for spike information.
Definition: event.h:320
Base class for all NEST network objects.
Definition: node.h:96
Node * thread_lid_to_node(thread t, targetindex thread_local_id) const
Definition: network.h:900
void simulate(Time const &)
Definition: network.cpp:652
void reset_kernel()
Reset number of threads to one, reset device prefix to the empty string and call reset().
Definition: network.cpp:252
long getValue< long >(const Token &t)
Definition: tokenutils.cc:36
bool model_in_use(index i)
Check, if there are instances of a given model.
Definition: network.cpp:647
bool overwrite_files() const
Indicate if existing data files should be overwritten.
Definition: network.h:1211
Model * get_model(index) const
Return the Model for a given model ID.
Definition: network.h:1169
bool get_simulated() const
Return true, if the network has already been simulated for some time.
Definition: scheduler.h:716
A type-independent container for C++-types.
Definition: token.h:68
int get_model_id(const char[]) const
Return the model id for a given model name.
Definition: network.cpp:320
void try_unregister_model(index m_id)
Try unregistering model prototype.
Definition: network.cpp:1806
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...
Definition: network.cpp:1869
void memory_info()
Definition: network.cpp:662
Schedule update of Nodes and Events during simulation.
Definition: scheduler.h:66
bool is_local_gid(index gid) const
Return true, if the given gid is on the local machine.
Definition: network.h:1020
bool is_local_node(Node *) const
Return true, if the given Node is on the local machine.
Definition: network.h:1014
void publish_music_in_ports_()
Publish all MUSIC input ports that were registered using Network::register_music_event_in_proxy().
Definition: network.cpp:1906
delay get_min_delay() const
Return minimal connection delay.
Definition: network.h:1062
void reset_network()
Reset the network to the state at T = 0.
Definition: network.cpp:272
void set_status_single_node_(Node &, const DictionaryDatum &, bool clear_flags=true)
Helper function to set properties on single node.
Definition: network.cpp:776
bool model_defaults_modified() const
Definition: network.h:779
const Name p("p")
current release probability (Tsodyks2_connection)
Definition: nest_names.h:218
Definition: connector_model.h:38
Node * get_node_by_gid(index) const
Lookup node based on GID.
Definition: sparse_node_array.cpp:88
Modelrangemanager node_model_ids_
ConnBuilder factories, indexed by connruledict_ elements.
Definition: network.h:862
Exception to be thrown if the specified Node does not exist.
Definition: exceptions.h:175
int_t thread
Thread index type.
Definition: nest.h:133
MusicPortData()
Definition: network.h:737
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
index size() const
Return total number of network nodes.
Definition: network.h:894
const double e
Definition: numerics.cpp:62
bool dict_miss_is_error() const
Returns true if unread dictionary items should be treated as error.
Definition: network.h:1243
double_t acceptable_latency
Definition: network.h:740
void register_basis_model(Model &m, bool private_model=false)
Registers a fundamental model for use with the network.
Definition: network.cpp:1730
DictionaryDatum get_status(index)
Get properties of a node.
Definition: network.cpp:837
thread get_num_sim_processes() const
Definition: scheduler.h:635
Node * thread_lid_to_node(thread t, targetindex thread_local_id) const
Definition: scheduler.h:762
Time const & get_slice_origin() const
Get the time at the beginning of the current time slice.
Definition: network.h:954
void set_data_path_prefix_(const DictionaryDatum &d)
Helper function to set device data path and prefix.
Definition: network.cpp:796
void restore_nodes(ArrayDatum &)
Restore nodes from an array of status dictionaries.
Definition: network.cpp:567
index register_model(Model &m, bool private_model=false)
Register a built-in model for use with the network.
Definition: network.cpp:1744
thread suggest_rec_vp(index gid) const
Return a thread number for a given global recording node id.
Definition: scheduler.h:684