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

Abstract base class for parameters. More...

#include <parameter.h>

Inheritance diagram for nest::Parameter:
[legend]

Public Member Functions

 Parameter (bool is_spatial=false, bool returns_int_only=false)
 Creates a Parameter, with optionally specified attributes.
 
 Parameter (const Parameter &p)=default
 
virtual ~Parameter ()=default
 
virtual double value (RngPtr, Node *)
 Generates a value based on parameter specifications and arguments.
 
virtual double value (RngPtr rng, const std::vector< double > &source_pos, const std::vector< double > &target_pos, const AbstractLayer &layer, Node *node)
 Generates a value based on parameter specifications and arguments.
 
std::vector< double > apply (const NodeCollectionPTR &, const std::vector< std::vector< double > > &)
 Applies a parameter on a single-node ID NodeCollection and given array of positions.
 
bool is_spatial () const
 Check if the Parameter is based on spatial properties.
 
bool returns_int_only () const
 Check if the Parameter only returns integer values.
 

Protected Member Functions

bool value_is_integer_ (const double value) const
 

Protected Attributes

bool is_spatial_ { false }
 
bool returns_int_only_ { false }
 

Detailed Description

Abstract base class for parameters.

Constructor & Destructor Documentation

◆ Parameter() [1/2]

nest::Parameter::Parameter ( bool  is_spatial = false,
bool  returns_int_only = false 
)
inline

Creates a Parameter, with optionally specified attributes.

Parameters
is_spatialtrue if the Parameter contains spatial elements
returns_int_onlytrue if the value of the parameter can only be an integer

◆ Parameter() [2/2]

nest::Parameter::Parameter ( const Parameter &  p)
explicitdefault

◆ ~Parameter()

virtual nest::Parameter::~Parameter ( )
virtualdefault

Member Function Documentation

◆ apply()

std::vector< double > nest::Parameter::apply ( const NodeCollectionPTR &  nc,
const std::vector< std::vector< double > > &  positions 
)

Applies a parameter on a single-node ID NodeCollection and given array of positions.

Returns
array of result values, one per position in the vector.

References nest::get_rank_synced_rng(), and value().

Here is the call graph for this function:

◆ is_spatial()

bool nest::Parameter::is_spatial ( ) const
inline

Check if the Parameter is based on spatial properties.

Returns
true if the Parameter is based on spatial properties, false otherwise.

References is_spatial_.

◆ returns_int_only()

bool nest::Parameter::returns_int_only ( ) const
inline

Check if the Parameter only returns integer values.

Returns
true if the Parameter only returns integers, false otherwise.

References returns_int_only_.

◆ value() [1/2]

double nest::Parameter::value ( RngPtr  rng,
const std::vector< double > &  source_pos,
const std::vector< double > &  target_pos,
const AbstractLayer &  layer,
Node *  node 
)
inlinevirtual

Generates a value based on parameter specifications and arguments.

Used when connecting spatial nodes. Note that not all parameters support all overloaded versions.

Parameters
rngpointer to the random number generator
source_posposition of the source node
target_posposition of the target node
layerspatial layer
nodetarget node, required for normal and lognormal parameters
Returns
the value of the parameter.

Reimplemented in nest::SpatialDistanceParameter, nest::ConstantParameter, nest::UniformParameter, nest::UniformIntParameter, nest::NormalParameter, nest::LognormalParameter, nest::ExponentialParameter, nest::DimensionParameter, nest::ExpDistParameter, nest::GaussianParameter, nest::Gaussian2DParameter, nest::GaborParameter, nest::GammaParameter, nest::ProductParameter, nest::QuotientParameter, nest::SumParameter, nest::DifferenceParameter, nest::ComparingParameter, nest::ConditionalParameter, nest::MinParameter, nest::MaxParameter, nest::RedrawParameter, nest::ExpParameter, nest::SinParameter, nest::CosParameter, nest::PowParameter, nest::ExpDistParameter, nest::GaussianParameter, nest::Gaussian2DParameter, nest::GaborParameter, nest::GammaParameter, and nest::NodePosParameter.

References value().

Here is the call graph for this function:

◆ value() [2/2]

virtual double nest::Parameter::value ( RngPtr  ,
Node *   
)
inlinevirtual

Generates a value based on parameter specifications and arguments.

Used when getting a parameter value based on random values or node attributes, like position. Note that not all parameters support all overloaded versions.

Parameters
rngpointer to the random number generator
nodepointer to the node, used when the node position is relevant
Returns
the value of the parameter.

Reimplemented in nest::UniformParameter, nest::UniformIntParameter, nest::ExponentialParameter, nest::NormalParameter, nest::LognormalParameter, nest::ProductParameter, nest::QuotientParameter, nest::SumParameter, nest::DifferenceParameter, nest::ComparingParameter, nest::ConditionalParameter, nest::MinParameter, nest::MaxParameter, nest::RedrawParameter, nest::ExpParameter, nest::SinParameter, nest::CosParameter, nest::PowParameter, nest::ConstantParameter, nest::UniformParameter, nest::UniformIntParameter, nest::NormalParameter, nest::LognormalParameter, nest::ExponentialParameter, nest::DimensionParameter, nest::ExpDistParameter, nest::GaussianParameter, nest::Gaussian2DParameter, nest::GaborParameter, nest::GammaParameter, nest::ConstantParameter, nest::SpatialDistanceParameter, nest::DimensionParameter, nest::ExpDistParameter, nest::GaussianParameter, nest::Gaussian2DParameter, nest::GaborParameter, nest::GammaParameter, and nest::NodePosParameter.

Referenced by apply(), value(), and value_is_integer_().

Here is the caller graph for this function:

◆ value_is_integer_()

bool nest::Parameter::value_is_integer_ ( const double  value) const
inlineprotected

References value().

Referenced by nest::ConstantParameter::ConstantParameter(), and nest::ConstantParameter::ConstantParameter().

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

Member Data Documentation

◆ is_spatial_

bool nest::Parameter::is_spatial_ { false }
protected

◆ returns_int_only_

bool nest::Parameter::returns_int_only_ { false }
protected

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