NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::Model Class Referenceabstract

Base class for all Models. More...

#include <model.h>

Inheritance diagram for nest::Model:
[legend]

Public Member Functions

 Model (const std::string &name)
 
 Model (const Model &m)
 
virtual ~Model ()
 
virtual Model * clone (const std::string &) const =0
 Create clone with new name.
 
void set_threads ()
 Set number of threads based on number set in network.
 
Node * create (size_t t)
 Allocate new Node and return its pointer.
 
void clear ()
 Deletes all nodes which belong to this model.
 
void reserve_additional (size_t t, size_t n)
 Reserve space for n additional Nodes.
 
std::string get_name () const
 Return name of the Model.
 
size_t mem_available ()
 Return the available memory.
 
size_t mem_capacity ()
 Return the memory capacity.
 
virtual bool has_proxies ()=0
 
virtual bool one_node_per_process ()=0
 
virtual bool is_off_grid ()=0
 
virtual void calibrate_time (const TimeConverter &tc)=0
 
void set_status (const Dictionary &)
 Change properties of the prototype node according to the entries in the dictionary.
 
Dictionary get_status ()
 Export properties of the prototype node by setting entries in the status dictionary.
 
virtual size_t send_test_event (Node &, size_t, synindex, bool)=0
 
virtual void sends_secondary_event (GapJunctionEvent &ge)=0
 
virtual void sends_secondary_event (InstantaneousRateConnectionEvent &re)=0
 
virtual void sends_secondary_event (DiffusionConnectionEvent &de)=0
 
virtual void sends_secondary_event (DelayedRateConnectionEvent &re)=0
 
virtual void sends_secondary_event (LearningSignalConnectionEvent &re)=0
 
virtual void sends_secondary_event (SICEvent &sic)=0
 
virtual SignalType sends_signal () const =0
 Check what type of signal this model is sending.
 
virtual size_t get_element_size () const =0
 Return the size of the prototype.
 
virtual Node const & get_prototype () const =0
 Return const reference to the prototype.
 
virtual void set_model_id (int)=0
 Set the model id on the prototype.
 
virtual int get_model_id ()=0
 Get the model id from the prototype.
 
virtual void deprecation_warning (const std::string &)=0
 Issue deprecation warning on first call if model is deprecated.
 
void set_type_id (size_t id)
 Set the model id on the prototype.
 
size_t get_type_id () const
 

Private Member Functions

virtual void set_status_ (const Dictionary &)=0
 
virtual Dictionary get_status_ ()=0
 
void set_threads_ (size_t t)
 Set the number of threads.
 
virtual Node * create_ ()=0
 Create a new object.
 

Private Attributes

std::string name_
 Name of the Model.
 
size_t type_id_
 Identifier of the model C++ type.
 
std::vector< std::vector< Node * > > memory_
 Memory for all nodes sorted by threads.
 

Detailed Description

Base class for all Models.

Each Node class is associated with a corresponding Model class. The Model class is responsible for the creation and class wide parametrisation of its associated Node objects.

class Model manages the thread-sorted memory pool of the model. The default constructor uses one thread as default. Use set_threads() to use more than one thread.

See also
Node

Constructor & Destructor Documentation

◆ Model() [1/2]

nest::Model::Model ( const std::string &  name)

◆ Model() [2/2]

nest::Model::Model ( const Model &  m)
inline

◆ ~Model()

virtual nest::Model::~Model ( )
inlinevirtual

Member Function Documentation

◆ calibrate_time()

virtual void nest::Model::calibrate_time ( const TimeConverter &  tc)
pure virtual

◆ clear()

void nest::Model::clear ( )

Deletes all nodes which belong to this model.

References memory_, and set_threads_().

Here is the call graph for this function:

◆ clone()

virtual Model * nest::Model::clone ( const std::string &  ) const
pure virtual

Create clone with new name.

Implemented in nest::GenericModel< ElementT >.

Referenced by nest::ModelManager::copy_node_model_().

Here is the caller graph for this function:

◆ create()

Node * nest::Model::create ( size_t  t)
inline

Allocate new Node and return its pointer.

create() is not const, because it is allowed to modify the Model object for 'administrative' purposes.

References create_(), and memory_.

Referenced by nest::ModelManager::create_proxynode_().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_()

virtual Node * nest::Model::create_ ( )
privatepure virtual

Create a new object.

Implemented in nest::GenericModel< ElementT >.

Referenced by create().

Here is the caller graph for this function:

◆ deprecation_warning()

virtual void nest::Model::deprecation_warning ( const std::string &  )
pure virtual

Issue deprecation warning on first call if model is deprecated.

Parameters
callingfunction

Implemented in nest::GenericModel< ElementT >.

Referenced by nest::ModelManager::copy_node_model_().

Here is the caller graph for this function:

◆ get_element_size()

virtual size_t nest::Model::get_element_size ( ) const
pure virtual

Return the size of the prototype.

Implemented in nest::GenericModel< ElementT >.

◆ get_model_id()

virtual int nest::Model::get_model_id ( )
pure virtual

Get the model id from the prototype.

Implemented in nest::GenericModel< ElementT >.

◆ get_name()

std::string nest::Model::get_name ( ) const
inline

Return name of the Model.

This function returns the name of the Model as C++ string. The name is defined by the constructor. The result is identical to the value of Node::get_name();

See also
Model::Model()
Node::get_name()

References name_.

Referenced by nest::NodeCollectionPrimitive::assert_consistent_model_ids_(), nest::ModelManager::compare_model_by_id_(), nest::Node::get_name(), get_status(), nest::ModelManager::memory_info(), nest::NodeManager::print(), nest::NodeCollectionComposite::print_me(), nest::NodeCollectionPrimitive::print_primitive(), and set_status().

Here is the caller graph for this function:

◆ get_prototype()

virtual Node const & nest::Model::get_prototype ( ) const
pure virtual

Return const reference to the prototype.

Implemented in nest::GenericModel< ElementT >.

◆ get_status_()

virtual Dictionary nest::Model::get_status_ ( )
privatepure virtual

Implemented in nest::GenericModel< ElementT >.

Referenced by get_status().

Here is the caller graph for this function:

◆ get_type_id()

size_t nest::Model::get_type_id ( ) const
inline

References type_id_.

Referenced by nest::GenericModel< ElementT >::GenericModel().

Here is the caller graph for this function:

◆ has_proxies()

virtual bool nest::Model::has_proxies ( )
pure virtual

Implemented in nest::GenericModel< ElementT >.

Referenced by nest::NodeCollectionPrimitive::NodeCollectionPrimitive().

Here is the caller graph for this function:

◆ is_off_grid()

virtual bool nest::Model::is_off_grid ( )
pure virtual

◆ mem_available()

size_t nest::Model::mem_available ( )

Return the available memory.

The result is given in number of elements, not in bytes.

Note that this function reports a sum over all threads.

References memory_.

◆ mem_capacity()

size_t nest::Model::mem_capacity ( )

Return the memory capacity.

The result is given in number of elements, not in bytes.

Note that this function reports a sum over all threads.

References memory_.

◆ one_node_per_process()

virtual bool nest::Model::one_node_per_process ( )
pure virtual

◆ reserve_additional()

void nest::Model::reserve_additional ( size_t  t,
size_t  n 
)

Reserve space for n additional Nodes.

References memory_.

◆ send_test_event()

virtual size_t nest::Model::send_test_event ( Node &  ,
size_t  ,
synindex  ,
bool   
)
pure virtual

◆ sends_secondary_event() [1/6]

virtual void nest::Model::sends_secondary_event ( DelayedRateConnectionEvent &  re)
pure virtual

◆ sends_secondary_event() [2/6]

virtual void nest::Model::sends_secondary_event ( DiffusionConnectionEvent &  de)
pure virtual

◆ sends_secondary_event() [3/6]

virtual void nest::Model::sends_secondary_event ( GapJunctionEvent &  ge)
pure virtual

Implemented in nest::GenericModel< ElementT >.

Referenced by nest::proxynode::sends_secondary_event(), nest::proxynode::sends_secondary_event(), nest::proxynode::sends_secondary_event(), nest::proxynode::sends_secondary_event(), nest::proxynode::sends_secondary_event(), and nest::proxynode::sends_secondary_event().

Here is the caller graph for this function:

◆ sends_secondary_event() [4/6]

virtual void nest::Model::sends_secondary_event ( InstantaneousRateConnectionEvent &  re)
pure virtual

◆ sends_secondary_event() [5/6]

virtual void nest::Model::sends_secondary_event ( LearningSignalConnectionEvent &  re)
pure virtual

◆ sends_secondary_event() [6/6]

virtual void nest::Model::sends_secondary_event ( SICEvent &  sic)
pure virtual

◆ sends_signal()

virtual SignalType nest::Model::sends_signal ( ) const
pure virtual

Check what type of signal this model is sending.

Required so that proxynode can formward this call to model that in turn delegates the call to the underlying prototype.

Implemented in nest::GenericModel< ElementT >.

Referenced by nest::proxynode::sends_signal().

Here is the caller graph for this function:

◆ set_model_id()

virtual void nest::Model::set_model_id ( int  )
pure virtual

Set the model id on the prototype.

Implemented in nest::GenericModel< ElementT >.

Referenced by nest::ModelManager::copy_node_model_().

Here is the caller graph for this function:

◆ set_status_()

virtual void nest::Model::set_status_ ( const Dictionary &  )
privatepure virtual

Implemented in nest::GenericModel< ElementT >.

Referenced by set_status().

Here is the caller graph for this function:

◆ set_threads()

void nest::Model::set_threads ( )

Set number of threads based on number set in network.

As long as no nodes of the model have been allocated, the number of threads may be changed.

Note
Requires that network pointer in NestModule is initialized.

References nest::kernel(), and set_threads_().

Referenced by nest::GenericModel< ElementT >::GenericModel(), nest::GenericModel< ElementT >::GenericModel(), and nest::ModelManager::initialize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_threads_()

void nest::Model::set_threads_ ( size_t  t)
private

Set the number of threads.

See also
set_threads()

References memory_.

Referenced by clear(), and set_threads().

Here is the caller graph for this function:

◆ set_type_id()

void nest::Model::set_type_id ( size_t  id)
inline

Set the model id on the prototype.

References type_id_.

Referenced by nest::GenericModel< ElementT >::GenericModel(), and nest::ModelManager::initialize().

Here is the caller graph for this function:

Member Data Documentation

◆ memory_

std::vector< std::vector< Node* > > nest::Model::memory_
private

Memory for all nodes sorted by threads.

Referenced by clear(), create(), get_status(), mem_available(), mem_capacity(), reserve_additional(), and set_threads_().

◆ name_

std::string nest::Model::name_
private

Name of the Model.

This name will be used to identify all Nodes which are created by this model object.

Referenced by get_name().

◆ type_id_

size_t nest::Model::type_id_
private

Identifier of the model C++ type.

For pristine models, the type_id equals the model_id. For copied models, the type_id equals the type_id of the base model. This number is needed to automatically save and restore copied models.

Referenced by get_status(), get_type_id(), and set_type_id().


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