Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
Functions
sim_srm0_steps.cpp File Reference

Simulates multiple step currents of increasing amplitude to 100 SRM0 neurons. More...

#include "auryn.h"
Include dependency graph for sim_srm0_steps.cpp:

Functions

int main (int ac, char *av[])
 

Detailed Description

Simulates multiple step currents of increasing amplitude to 100 SRM0 neurons.

Function Documentation

◆ main()

int main ( int  ac,
char *  av[] 
)
33 {
34 
35  int errcode = 0;
36  char strbuf [255];
37  string simname = "srm0steps";
38  auryn_init( ac, av, ".", simname );
39 
40  // define neuron group
41  SRM0Group* neuron = new SRM0Group(100);
42 
43  // define current input
44  CurrentInjector * curinject = new CurrentInjector(neuron, "mem");
45 
46  // define monitors
47  SpikeMonitor * smon = new SpikeMonitor( neuron, sys->fn("ras") );
48  VoltageMonitor * vmon = new VoltageMonitor( neuron, 0, sys->fn("mem") );
49  StateMonitor * wmon = new StateMonitor( neuron, 0, "w", sys->fn("w") );
50  PopulationRateMonitor * prmon = new PopulationRateMonitor( neuron, sys->fn("prate"), 10e-3 );
51 
52  // run simulation
53  logger->msg("Running ...",PROGRESS);
54 
55  const double simtime = 0.2;
56  // simulate
57  sys->run(simtime);
58 
59  // simulate current steps of increasing size
60  for ( int i = 0 ; i < 10 ; ++i ) {
61  // turn current on
62  curinject->set_all_currents(0.1*i); // current is in arbitrary units
63 
64  // simulate
65  sys->run(simtime);
66 
67  // turn current off
68  curinject->set_all_currents(0.0);
69 
70  // simulate
71  sys->run(simtime);
72  }
73 
74  if (errcode)
75  auryn_abort(errcode);
76 
77  logger->msg("Freeing ...",PROGRESS,true);
78  auryn_free();
79  return errcode;
80 }
void auryn_free()
Cleanly shuts down Auryn simulation environment.
Definition: auryn_global.cpp:107
Implements SRM0 neuron model with escape noise.
Definition: SRM0Group.h:50
Stimulator class to add values in each timestep to arbitrary neuronal states.
Definition: CurrentInjector.h:49
void set_all_currents(AurynFloat current)
Sets current strength for all neurons.
Definition: CurrentInjector.cpp:66
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
The standard Monitor object to record spikes from a SpikingGroup and write them to a text file...
Definition: SpikeMonitor.h:52
void auryn_abort(int errcode)
Terminates Auryn simulation abnormally.
Definition: auryn_global.cpp:113
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
Records the membrane potential from one unit from the source neuron group to a file.
Definition: VoltageMonitor.h:48
void auryn_init(int ac, char *av[], string dir, string simulation_name, string logfile_prefix, LogMessageType filelog_level, LogMessageType consolelog_level)
Initalizes MPI and the Auryn simulation environment.
Definition: auryn_global.cpp:84
void msg(std::string text, LogMessageType type=NOTIFICATION, bool global=false, int line=-1, std::string srcfile="")
Definition: Logger.cpp:74
Definition: Logger.h:41
string fn(std::string extension)
Format output file name.
Definition: System.cpp:689
Monitor class to record population firing rates.
Definition: PopulationRateMonitor.h:46
Records from an arbitray state vector of one unit from the source SpikingGroup to a file...
Definition: StateMonitor.h:40
Here is the call graph for this function: