NEST main@f146f75
Loading...
Searching...
No Matches
nest::ComparingParameter Class Reference

Parameter class representing the comparison of two parameters. More...

#include <parameter.h>

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

Public Member Functions

 ComparingParameter (ParameterPTR m1, ParameterPTR m2, const Dictionary &d)
 Construct the comparison of the two given parameters.
 ComparingParameter (const ComparingParameter &p)
double value (RngPtr rng, Node *node) override
double value (RngPtr rng, const std::vector< double > &source_pos, const std::vector< double > &target_pos, const AbstractLayer &layer, Node *node) override
 Generates a value based on parameter specifications and arguments.
Public Member Functions inherited from nest::Parameter
 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
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 Attributes

ParameterPTR const parameter1_
ParameterPTR const parameter2_
Protected Attributes inherited from nest::Parameter
bool is_spatial_ { false }
bool returns_int_only_ { false }

Private Member Functions

bool compare_ (double value_a, double value_b) const

Private Attributes

int comparator_

Additional Inherited Members

Protected Member Functions inherited from nest::Parameter
bool value_is_integer_ (const double value) const

Detailed Description

Parameter class representing the comparison of two parameters.

Constructor & Destructor Documentation

◆ ComparingParameter() [1/2]

nest::ComparingParameter::ComparingParameter ( ParameterPTR m1,
ParameterPTR m2,
const Dictionary & d )
inline

Construct the comparison of the two given parameters.

Copies are made of the supplied Parameter objects.

comparator - Operator to use as a comparator. 0: < 2: <= 4: == 5: != 3: >= 1: >

References nest::names::comparator(), comparator_, nest::Parameter::is_spatial(), nest::Parameter::Parameter(), parameter1_, and parameter2_.

Referenced by ComparingParameter().

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

◆ ComparingParameter() [2/2]

nest::ComparingParameter::ComparingParameter ( const ComparingParameter & p)
inline

References comparator_, ComparingParameter(), nest::Parameter::Parameter(), parameter1_, and parameter2_.

Here is the call graph for this function:

Member Function Documentation

◆ compare_()

bool nest::ComparingParameter::compare_ ( double value_a,
double value_b ) const
inlineprivate

References comparator_.

Referenced by value(), and value().

Here is the caller graph for this function:

◆ value() [1/2]

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

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 from nest::Parameter.

References compare_(), parameter1_, and parameter2_.

Here is the call graph for this function:

◆ value() [2/2]

double nest::ComparingParameter::value ( RngPtr rng,
Node * node )
inlineoverridevirtual
Returns
the result of the comparison, bool given as a double.

Reimplemented from nest::Parameter.

References compare_(), parameter1_, and parameter2_.

Here is the call graph for this function:

Member Data Documentation

◆ comparator_

int nest::ComparingParameter::comparator_
private

◆ parameter1_

ParameterPTR const nest::ComparingParameter::parameter1_
protected

◆ parameter2_

ParameterPTR const nest::ComparingParameter::parameter2_
protected

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