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

Records sum of all weights in synaptic weight matrix in predefined intervals. More...

#include <WeightSumMonitor.h>

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

Public Member Functions

 WeightSumMonitor (Connection *source, string filename, AurynDouble binsize=1.0)
 
virtual ~WeightSumMonitor ()
 
void execute ()
 

Protected Member Functions

void init (Connection *source, string filename, AurynTime stepsize)
 
- Protected Member Functions inherited from auryn::Monitor
virtual void open_output_file (std::string filename)
 
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)
 
virtual void flush ()
 Flush to file. More...
 
 Monitor (std::string filename, std::string default_extension="dat")
 Standard constructor with file name. More...
 
 Monitor ()
 Constructor which does not open a text file for output. More...
 
std::string generate_filename (std::string name_hint="")
 Generates a default filename from the device ID. More...
 
virtual ~Monitor ()
 Standard destructor. More...
 
- Protected Member Functions inherited from auryn::Device
void init ()
 Standard initializer to be called by the constructor. More...
 
 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 ~Device ()
 Standard destructor. More...
 
virtual void evolve ()
 

Protected Attributes

Connectionsrc
 
AurynTime ssize
 
NeuronID data_size_limit
 
- Protected Attributes inherited from auryn::Monitor
std::ofstream outfile
 
std::string fname
 
std::string default_file_extension
 
bool active
 Standard active switch. More...
 
- Protected Attributes inherited from auryn::Device
std::string device_name
 Identifying name for device. More...
 
bool active
 Standard active switch. More...
 

Detailed Description

Records sum of all weights in synaptic weight matrix in predefined intervals.

Constructor & Destructor Documentation

◆ WeightSumMonitor()

WeightSumMonitor::WeightSumMonitor ( Connection source,
std::string  filename,
AurynDouble  binsize = 1.0 
)
30  : Monitor(filename)
31 {
32  init(source,filename,binsize/auryn_timestep);
33 }
void init()
Standard initializer to be called by the constructor.
Definition: Device.cpp:32
Monitor()
Constructor which does not open a text file for output.
Definition: Monitor.cpp:47
double auryn_timestep
Simulation timestep in seconds.
Definition: auryn_definitions.cpp:31
Here is the call graph for this function:

◆ ~WeightSumMonitor()

WeightSumMonitor::~WeightSumMonitor ( )
virtual
36 {
37 }

Member Function Documentation

◆ execute()

void WeightSumMonitor::execute ( )
virtual

Virtual execute function to be called at the end of central simulation loop in System

Reimplemented from auryn::Device.

53 {
54  if (auryn::sys->get_clock()%ssize==0) {
55  AurynDouble weightsum;
56  AurynDouble weightstd;
57  src->stats(weightsum, weightstd);
58  outfile << (auryn::sys->get_time()) << " " << weightsum << std::endl;
59  }
60 
61 }
AurynTime ssize
Definition: WeightSumMonitor.h:46
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
Connection * src
Definition: WeightSumMonitor.h:45
virtual void stats(AurynDouble &mean, AurynDouble &std, StateID zid=0)=0
Computes mean synaptic weight and std dev of all weights in this connection.
std::ofstream outfile
Definition: Monitor.h:58
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
AurynDouble get_time()
Gets the current system time in [s].
Definition: System.cpp:226
Here is the call graph for this function:

◆ init()

void WeightSumMonitor::init ( Connection source,
std::string  filename,
AurynTime  stepsize 
)
protected
40 {
41  if ( !source->get_destination()->evolve_locally() ) return;
42 
44 
45  src = source;
46  ssize = stepsize;
47  if ( ssize < 1 ) ssize = 1;
48 
49  outfile << std::setiosflags(std::ios::fixed) << std::setprecision(6);
50 }
AurynTime ssize
Definition: WeightSumMonitor.h:46
NeuronGroup * get_destination()
Returns pointer to the postsynaptic group.
Definition: Connection.cpp:203
Connection * src
Definition: WeightSumMonitor.h:45
bool evolve_locally()
Returns true if the calling instance has units which are integrated on the current rank...
Definition: SpikingGroup.cpp:323
std::ofstream outfile
Definition: Monitor.h:58
void register_device(Device *device)
Registers an instance of Device to the devices vector.
Definition: System.cpp:272
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
Here is the call graph for this function:

Member Data Documentation

◆ data_size_limit

NeuronID auryn::WeightSumMonitor::data_size_limit
protected

◆ src

Connection* auryn::WeightSumMonitor::src
protected

◆ ssize

AurynTime auryn::WeightSumMonitor::ssize
protected

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