Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
Public Member Functions | Protected Attributes | List of all members
auryn::NormalStimulator Class Reference

Stimulator class to inject timeseries of currents to patterns (subpopulations) of neurons. More...

#include <NormalStimulator.h>

Inheritance diagram for auryn::NormalStimulator:
Inheritance graph
[legend]
Collaboration diagram for auryn::NormalStimulator:
Collaboration graph
[legend]

Public Member Functions

 NormalStimulator (NeuronGroup *target, AurynWeight sigma=1.0, string target_state="inj_current")
 
virtual ~NormalStimulator ()
 
void set_sigma (AurynFloat sigma)
 
AurynFloat get_sigma ()
 
void seed (int s)
 
void set_target_state (string state_name="inj_current")
 
void execute ()
 

Protected Attributes

NeuronGroupdst
 
- Protected Attributes inherited from auryn::Device
std::string device_name
 Identifying name for device. More...
 
bool active
 Standard active switch. More...
 

Additional Inherited Members

- Protected Member Functions inherited from auryn::Device
void init ()
 Standard initializer to be called by the constructor. More...
 
virtual void virtual_serialize (boost::archive::binary_oarchive &ar, const unsigned int version)
 
virtual void virtual_serialize (boost::archive::binary_iarchive &ar, const unsigned int version)
 
 Device ()
 Standard constructor. More...
 
void set_name (std::string s)
 Set device name. More...
 
std::string get_name ()
 Get device name. More...
 
int get_id ()
 Get numeric device id. More...
 
virtual void flush ()
 Flush to file. More...
 
virtual ~Device ()
 Standard destructor. More...
 
virtual void evolve ()
 

Detailed Description

Stimulator class to inject timeseries of currents to patterns (subpopulations) of neurons.

Instances of this class inject currents that vary over time to subpopulations of the NeuronGroup assigned.

Constructor & Destructor Documentation

◆ NormalStimulator()

NormalStimulator::NormalStimulator ( NeuronGroup target,
AurynWeight  sigma = 1.0,
std::string  target_state = "inj_current" 
)

Default Constructor

Parameters
27  : Device( )
28 {
29  init(target, sigma, target_state);
30 }
void init()
Standard initializer to be called by the constructor.
Definition: Device.cpp:32
Device()
Standard constructor.
Definition: Device.cpp:41
Here is the call graph for this function:

◆ ~NormalStimulator()

NormalStimulator::~NormalStimulator ( )
virtual

Default Destructor

60 {
61  free();
62 }

Member Function Documentation

◆ execute()

void NormalStimulator::execute ( )
virtual

Implementation of necessary execute() function.

Reimplemented from auryn::Device.

65 {
66  if ( dst->evolve_locally() ) {
67  for ( NeuronID i = 0 ; i < dst->get_post_size() ; ++i ) {
68  float draw = (*die)();
69  target_vector->data[i] = draw;
70  }
71  }
72 }
T * data
Pointer to the array housing the data.
Definition: AurynVector.h:154
bool evolve_locally()
Returns true if the calling instance has units which are integrated on the current rank...
Definition: SpikingGroup.cpp:323
NeuronID get_post_size()
Returns the size on this rank.
Definition: SpikingGroup.cpp:314
NeuronGroup * dst
Definition: NormalStimulator.h:74
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
Here is the call graph for this function:

◆ get_sigma()

AurynFloat NormalStimulator::get_sigma ( )

Returns the event rate of the underlying Normal generator

80  {
81  return (AurynFloat) normal_sigma;
82 }
float AurynFloat
Low precision floating point datatype.
Definition: auryn_definitions.h:157

◆ seed()

void NormalStimulator::seed ( int  s)

Seeds the random number generator of all NormalStimulator objects

93 {
94  gen.seed(s);
95 }

◆ set_sigma()

void NormalStimulator::set_sigma ( AurynFloat  sigma)

Sets the event rate of the underlying Normal generator

74  {
75  delete dist;
76  normal_sigma = sigma;
77  dist = new boost::normal_distribution<float> (0.0, get_lambda());
78 }

◆ set_target_state()

void NormalStimulator::set_target_state ( std::string  state_name = "inj_current")

Sets the state that is stimulated with Normal input. This must be a valid state vector name (default = mem)

88  {
89  target_vector = dst->get_state_vector(state_name);
90 }
AurynStateVector * get_state_vector(std::string key)
Creates a new or returns an existing state vector by name.
Definition: SpikingGroup.cpp:781
NeuronGroup * dst
Definition: NormalStimulator.h:74
Here is the call graph for this function:

Member Data Documentation

◆ dst

NeuronGroup* auryn::NormalStimulator::dst
protected

The target NeuronGroup


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