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

Stimulator class to inject timeseries of currents NeuronGroups. More...

#include <PoissonStimulator.h>

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

Public Member Functions

 PoissonStimulator (NeuronGroup *target, AurynFloat rate=100.0, AurynWeight w=0.1)
 Default Constructor. More...
 
virtual ~PoissonStimulator ()
 Default Destructor. More...
 
void set_rate (AurynFloat rate)
 Sets the event rate of the underlying Poisson generator. More...
 
AurynFloat get_rate ()
 Returns the event rate of the underlying Poisson generator. More...
 
void seed (int s)
 Seeds the random number generator of all PoissonStimulator objects on this rank. More...
 
void set_target_state (string state_name="mem")
 Sets the state that is stimulated. More...
 
void execute ()
 Implementation of necessary execute() function. More...
 

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 NeuronGroups.

Instances of this class inject independent currents from a Poisson distribution to the NeuronGroup assigned.

Constructor & Destructor Documentation

◆ PoissonStimulator()

PoissonStimulator::PoissonStimulator ( NeuronGroup target,
AurynFloat  rate = 100.0,
AurynWeight  w = 0.1 
)

Default Constructor.

Parameters
32  : Device( )
33 {
34  init(target,rate,w);
35 }
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:

◆ ~PoissonStimulator()

PoissonStimulator::~PoissonStimulator ( )
virtual

Default Destructor.

66 {
67  free();
68 }

Member Function Documentation

◆ execute()

void PoissonStimulator::execute ( )
virtual

Implementation of necessary execute() function.

Reimplemented from auryn::Device.

71 {
72  if ( dst->evolve_locally() ) {
73  for ( NeuronID i = 0 ; i < dst->get_post_size() ; ++i ) {
74  int draw = (*die)();
75  target_vector->data[i] += draw*poisson_weight;
76  }
77  }
78 }
NeuronGroup * dst
Definition: PoissonStimulator.h:82
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
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_rate()

AurynFloat PoissonStimulator::get_rate ( )

Returns the event rate of the underlying Poisson generator.

86  {
87  return poisson_rate;
88 }

◆ seed()

void PoissonStimulator::seed ( int  s)

Seeds the random number generator of all PoissonStimulator objects on this rank.

Parameters
99 {
100  gen.seed(s);
101 }

◆ set_rate()

void PoissonStimulator::set_rate ( AurynFloat  rate)

Sets the event rate of the underlying Poisson generator.

Parameters
80  {
81  delete dist;
82  poisson_rate = rate;
83  dist = new boost::poisson_distribution<int> (get_lambda());
84 }

◆ set_target_state()

void PoissonStimulator::set_target_state ( std::string  state_name = "mem")

Sets the state that is stimulated.

This must be a valid state vector name (default = mem).

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

Member Data Documentation

◆ dst

NeuronGroup* auryn::PoissonStimulator::dst
protected

The target NeuronGroup


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