NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::ModelRangeManager Class Reference

#include <modelrange_manager.h>

Inheritance diagram for nest::ModelRangeManager:
[legend]
Collaboration diagram for nest::ModelRangeManager:
[legend]

Public Member Functions

 ModelRangeManager ()
 
 ~ModelRangeManager () override
 
void initialize (const bool) override
 Prepare manager for operation.
 
void finalize (const bool) override
 Take down manager after operation.
 
void set_status (const Dictionary &) override
 Set the status of the manager.
 
void get_status (Dictionary &) override
 Retrieve the status of the manager.
 
void add_range (size_t model, size_t first_node_id, size_t last_node_id)
 Assign a range of node IDs for the given model.
 
bool is_in_range (size_t node_id) const
 Check whether a node ID is with the range of assigned node IDs.
 
size_t get_model_id (size_t node_id) const
 Get the ID of the model to which this node ID is assigned.
 
Model * get_model_of_node_id (size_t)
 Return the Model for a given node ID.
 
const modelrange & get_contiguous_node_id_range (size_t node_id) const
 Return the contiguous range of IDs of nodes assigned to the same model as the node with the given node ID.
 
std::vector< modelrange >::const_iterator begin () const
 
std::vector< modelrange >::const_iterator end () const
 
- Public Member Functions inherited from nest::ManagerInterface
 ManagerInterface (ManagerInterface const &)=delete
 
void operator= (ManagerInterface const &)=delete
 
 ManagerInterface ()
 
virtual ~ManagerInterface ()
 
virtual void prepare ()
 
virtual void cleanup ()
 

Private Attributes

std::vector< modelrange > modelranges_
 
size_t first_node_id_
 
size_t last_node_id_
 

Constructor & Destructor Documentation

◆ ModelRangeManager()

nest::ModelRangeManager::ModelRangeManager ( )

◆ ~ModelRangeManager()

nest::ModelRangeManager::~ModelRangeManager ( )
inlineoverride

Member Function Documentation

◆ add_range()

void nest::ModelRangeManager::add_range ( size_t  model,
size_t  first_node_id,
size_t  last_node_id 
)

Assign a range of node IDs for the given model.

References first_node_id_, last_node_id_, and modelranges_.

Referenced by nest::NodeManager::add_node().

Here is the caller graph for this function:

◆ begin()

std::vector< modelrange >::const_iterator nest::ModelRangeManager::begin ( ) const
inline

References modelranges_.

◆ end()

std::vector< modelrange >::const_iterator nest::ModelRangeManager::end ( ) const
inline

References modelranges_.

Referenced by nest::NodeManager::print().

Here is the caller graph for this function:

◆ finalize()

void nest::ModelRangeManager::finalize ( const bool  adjust_number_of_threads_or_rng_only)
overridevirtual

Take down manager after operation.

After this method has completed, all dynamic data structures created by the manager shall be deallocated and containers emptied. Plain variables need not be reset.

Note
Finalization of any given manager may depend on other managers not having been finalized yet. KernelManager::finalize() is responsible for calling the initialization routines on the specific managers in correct order, i.e., the opposite order of initialize() calls.
Parameters
adjust_number_of_threads_or_rng_onlyPass true if calling from kernel_manager::change_number_of_threads() to limit operations to those necessary for thread adjustment.
See also
initialize()

Implements nest::ManagerInterface.

References first_node_id_, last_node_id_, and modelranges_.

◆ get_contiguous_node_id_range()

const modelrange & nest::ModelRangeManager::get_contiguous_node_id_range ( size_t  node_id) const

Return the contiguous range of IDs of nodes assigned to the same model as the node with the given node ID.

References is_in_range(), and modelranges_.

Here is the call graph for this function:

◆ get_model_id()

size_t nest::ModelRangeManager::get_model_id ( size_t  node_id) const

Get the ID of the model to which this node ID is assigned.

References is_in_range(), and modelranges_.

Referenced by nest::NodeCollectionPrimitive::assert_consistent_model_ids_(), nest::NodeCollection::create_(), get_model_of_node_id(), nest::ModelManager::get_proxy_node(), and nest::NodeCollectionPrimitive::NodeCollectionPrimitive().

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

◆ get_model_of_node_id()

Model * nest::ModelRangeManager::get_model_of_node_id ( size_t  node_id)

Return the Model for a given node ID.

References get_model_id(), nest::ModelManager::get_node_model(), nest::kernel(), and nest::KernelManager::model_manager.

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

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

◆ get_status()

void nest::ModelRangeManager::get_status ( Dictionary &  )
inlineoverridevirtual

Retrieve the status of the manager.

Note
This would ideally be a const function. However, some managers delay the update of internal variables up to the point where they are needed (e.g., before reporting their values to the user, or before simulate is called). An example for this pattern is the call to update_delay_extrema_() right at the beginning of ConnectionManager::get_status().
See also
set_status()

Implements nest::ManagerInterface.

◆ initialize()

void nest::ModelRangeManager::initialize ( const bool  adjust_number_of_threads_or_rng_only)
overridevirtual

Prepare manager for operation.

After this method has completed, the manager should be completely initialized and "ready for action".

Note
Initialization of any given manager may depend on other managers having been initialized before. KernelManager::initialize() is responsible for calling the initialization routines on the specific managers in correct order.
Parameters
adjust_number_of_threads_or_rng_onlyPass true if calling from kernel_manager::change_number_of_threads() or RandomManager::get_status() to limit operations to those necessary for thread adjustment or switch or re-seeding of RNG.
See also
finalize()

Implements nest::ManagerInterface.

◆ is_in_range()

bool nest::ModelRangeManager::is_in_range ( size_t  node_id) const
inline

Check whether a node ID is with the range of assigned node IDs.

References first_node_id_.

Referenced by get_contiguous_node_id_range(), and get_model_id().

Here is the caller graph for this function:

◆ set_status()

void nest::ModelRangeManager::set_status ( const Dictionary &  )
inlineoverridevirtual

Set the status of the manager.

See also
get_status()

Implements nest::ManagerInterface.

Member Data Documentation

◆ first_node_id_

size_t nest::ModelRangeManager::first_node_id_
private

Referenced by add_range(), finalize(), and is_in_range().

◆ last_node_id_

size_t nest::ModelRangeManager::last_node_id_
private

Referenced by add_range(), and finalize().

◆ modelranges_

std::vector< modelrange > nest::ModelRangeManager::modelranges_
private

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