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

Abstract base class for Layers of unspecified dimension. More...

#include <layer.h>

Inheritance diagram for nest::AbstractLayer:
[legend]

Public Member Functions

 AbstractLayer ()
 
virtual ~AbstractLayer ()
 
virtual void set_status (const Dictionary &)=0
 Change properties of the layer according to the entries in the dictionary.
 
virtual void get_status (Dictionary &, NodeCollection const *const) const =0
 Export properties of the layer by setting entries in the status dictionary, respects slicing of given NodeCollection.
 
virtual unsigned int get_num_dimensions () const =0
 
virtual std::vector< double > get_position_vector (const size_t lid) const =0
 Get position of node.
 
virtual std::vector< double > compute_displacement (const std::vector< double > &from_pos, const size_t to) const =0
 Returns displacement of node from given position.
 
virtual double compute_displacement (const std::vector< double > &from_pos, const std::vector< double > &to_pos, const unsigned int dimension) const =0
 
virtual double compute_distance (const std::vector< double > &from_pos, const size_t lid) const =0
 Returns distance to node from given position.
 
virtual double compute_distance (const std::vector< double > &from_pos, const std::vector< double > &to_pos) const =0
 
virtual void connect (NodeCollectionPTR source_nc, AbstractLayerPTR target, NodeCollectionPTR target_nc, ConnectionCreator &connector)=0
 Connect this layer to the given target layer.
 
virtual std::vector< size_t > get_global_nodes (const MaskPTR mask, const std::vector< double > &anchor, bool allow_oversized, NodeCollectionPTR node_collection)=0
 Return a vector with the node IDs of the nodes inside the mask.
 
virtual void dump_nodes (std::ostream &os) const =0
 Write layer data to stream.
 
virtual void dump_connections (std::ostream &out, NodeCollectionPTR node_collection, AbstractLayerPTR target_layer, const std::string &syn_model)=0
 Dumps information about all connections of the given type having their source in the given layer to the given output stream.
 
void set_node_collection (NodeCollectionPTR)
 
NodeCollectionPTR get_node_collection ()
 

Static Public Member Functions

static NodeCollectionPTR create_layer (const Dictionary &)
 Factory function for layers.
 

Protected Member Functions

virtual void clear_ntree_cache_ () const =0
 Clear the cache for global position information.
 
virtual void clear_vector_cache_ () const =0
 Clear the cache for global position information.
 
NodeCollectionMetadataPTR get_metadata () const
 Gets metadata of the NodeCollection to which this layer belongs.
 

Protected Attributes

NodeCollectionPTR node_collection_
 The NodeCollection to which the layer belongs.
 

Static Protected Attributes

static NodeCollectionMetadataPTR cached_ntree_md_ = NodeCollectionMetadataPTR( nullptr )
 Metadata for the layer for which we cache global position information.
 
static NodeCollectionMetadataPTR cached_vector_md_ = NodeCollectionMetadataPTR( nullptr )
 Metadata for the layer for which we cache global position information.
 

Detailed Description

Abstract base class for Layers of unspecified dimension.

Constructor & Destructor Documentation

◆ AbstractLayer()

nest::AbstractLayer::AbstractLayer ( )
inline

◆ ~AbstractLayer()

nest::AbstractLayer::~AbstractLayer ( )
virtual

Member Function Documentation

◆ clear_ntree_cache_()

virtual void nest::AbstractLayer::clear_ntree_cache_ ( ) const
protectedpure virtual

Clear the cache for global position information.

Implemented in nest::Layer< D >.

◆ clear_vector_cache_()

virtual void nest::AbstractLayer::clear_vector_cache_ ( ) const
protectedpure virtual

Clear the cache for global position information.

Implemented in nest::Layer< D >.

◆ compute_displacement() [1/2]

virtual std::vector< double > nest::AbstractLayer::compute_displacement ( const std::vector< double > &  from_pos,
const size_t  to 
) const
pure virtual

Returns displacement of node from given position.

When using periodic boundary conditions, will return minimum displacement.

Parameters
from_posposition vector in layer
tonode in layer to which displacement is to be computed
Returns
vector pointing from from_pos to node to's position

Implemented in nest::Layer< D >.

Referenced by nest::SpatialDistanceParameter::value().

Here is the caller graph for this function:

◆ compute_displacement() [2/2]

virtual double nest::AbstractLayer::compute_displacement ( const std::vector< double > &  from_pos,
const std::vector< double > &  to_pos,
const unsigned int  dimension 
) const
pure virtual

Implemented in nest::Layer< D >.

◆ compute_distance() [1/2]

virtual double nest::AbstractLayer::compute_distance ( const std::vector< double > &  from_pos,
const size_t  lid 
) const
pure virtual

Returns distance to node from given position.

When using periodic boundary conditions, will return minimum distance.

Parameters
from_posposition vector in layer
tonode in layer to which displacement is to be computed
Returns
length of vector pointing from from_pos to node to's position

Implemented in nest::Layer< D >.

Referenced by nest::SpatialDistanceParameter::value().

Here is the caller graph for this function:

◆ compute_distance() [2/2]

virtual double nest::AbstractLayer::compute_distance ( const std::vector< double > &  from_pos,
const std::vector< double > &  to_pos 
) const
pure virtual

Implemented in nest::Layer< D >.

◆ connect()

virtual void nest::AbstractLayer::connect ( NodeCollectionPTR  source_nc,
AbstractLayerPTR  target,
NodeCollectionPTR  target_nc,
ConnectionCreator &  connector 
)
pure virtual

Connect this layer to the given target layer.

The actual connections are made in class ConnectionCreator.

Parameters
source_ncNodeCollection of the source layer
targettarget layer to connect to. Must have same dimension as this layer.
target_ncNodeCollection of the target layer
connectorconnection properties

Implemented in nest::Layer< D >.

◆ create_layer()

NodeCollectionPTR nest::AbstractLayer::create_layer ( const Dictionary &  layer_dict)
static

Factory function for layers.

The supplied dictionary contains parameters which specify the layer type and type-specific parameters.

Returns
pointer to NodeCollection for new layer

References nest::NodeManager::add_node(), Dictionary::at(), nest::names::elements(), Dictionary::get(), nest::get_layer(), nest::ModelManager::get_node_model_id(), nest::kernel(), Dictionary::known(), nest::KernelManager::model_manager, nest::names::n(), nest::KernelManager::node_manager, nest::names::positions(), set_status(), and nest::names::shape().

Referenced by nest::create_layer().

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

◆ dump_connections()

virtual void nest::AbstractLayer::dump_connections ( std::ostream &  out,
NodeCollectionPTR  node_collection,
AbstractLayerPTR  target_layer,
const std::string &  syn_model 
)
pure virtual

Dumps information about all connections of the given type having their source in the given layer to the given output stream.

For distributed simulations this function will dump the connections with local targets only.

Parameters
outoutput stream
node_collectionNodeCollection of the layer
target_layerTarget layer
synapse_idtype of connection

Implemented in nest::Layer< D >.

◆ dump_nodes()

virtual void nest::AbstractLayer::dump_nodes ( std::ostream &  os) const
pure virtual

Write layer data to stream.

For each node in layer, write one line to stream containing: node ID x-position y-position [z-position]

Parameters
osoutput stream

Implemented in nest::Layer< D >.

◆ get_global_nodes()

virtual std::vector< size_t > nest::AbstractLayer::get_global_nodes ( const MaskPTR  mask,
const std::vector< double > &  anchor,
bool  allow_oversized,
NodeCollectionPTR  node_collection 
)
pure virtual

Return a vector with the node IDs of the nodes inside the mask.

Parameters
maskmask to apply.
anchorposition to center mask in.
allow_oversizedallow mask to be greater than layer
node_collectionNodeCollection of the layer
Returns
nodes in layer inside mask.

Implemented in nest::Layer< D >.

◆ get_metadata()

NodeCollectionMetadataPTR nest::AbstractLayer::get_metadata ( ) const
protected

Gets metadata of the NodeCollection to which this layer belongs.

References node_collection_.

◆ get_node_collection()

NodeCollectionPTR nest::AbstractLayer::get_node_collection ( )
inline

References node_collection_.

◆ get_num_dimensions()

virtual unsigned int nest::AbstractLayer::get_num_dimensions ( ) const
pure virtual

Implemented in nest::Layer< D >.

Referenced by nest::SpatialDistanceParameter::value().

Here is the caller graph for this function:

◆ get_position_vector()

virtual std::vector< double > nest::AbstractLayer::get_position_vector ( const size_t  lid) const
pure virtual

Get position of node.

Only possible for local nodes.

Parameters
lidglobal index of node within layer
Returns
position of node as std::vector

Implemented in nest::Layer< D >.

◆ get_status()

virtual void nest::AbstractLayer::get_status ( Dictionary &  ,
NodeCollection const * const   
) const
pure virtual

Export properties of the layer by setting entries in the status dictionary, respects slicing of given NodeCollection.

Parameters
dDictionary.
Note
If passing nullptr-valued NodeCollectionPTR, full metadata irrespective of any slicing is returned.

Implemented in nest::FreeLayer< D >, nest::Layer< D >, and nest::GridLayer< D >.

◆ set_node_collection()

void nest::AbstractLayer::set_node_collection ( NodeCollectionPTR  node_collection)
inline

References node_collection_.

◆ set_status()

virtual void nest::AbstractLayer::set_status ( const Dictionary &  )
pure virtual

Change properties of the layer according to the entries in the dictionary.

Parameters
dDictionary with named parameter settings.

Implemented in nest::FreeLayer< D >, nest::Layer< D >, and nest::GridLayer< D >.

Referenced by create_layer().

Here is the caller graph for this function:

Member Data Documentation

◆ cached_ntree_md_

NodeCollectionMetadataPTR nest::AbstractLayer::cached_ntree_md_ = NodeCollectionMetadataPTR( nullptr )
staticprotected

Metadata for the layer for which we cache global position information.

◆ cached_vector_md_

NodeCollectionMetadataPTR nest::AbstractLayer::cached_vector_md_ = NodeCollectionMetadataPTR( nullptr )
staticprotected

Metadata for the layer for which we cache global position information.

◆ node_collection_

NodeCollectionPTR nest::AbstractLayer::node_collection_
protected

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