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

Simulates multiple step currents of increasing amplitude to a neuron. More...

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

Functions

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

Detailed Description

Simulates multiple step currents of increasing amplitude to a neuron.

Function Documentation

◆ main()

int main ( int  ac,
char *  av[] 
)
33 {
34 
35  int errcode = 0;
36  char strbuf [255];
37  string simname = "current_steps";
38  auryn_init( ac, av, ".", simname );
39 
40  // define neuron group
41  AdExGroup* neuron = new AdExGroup(1);
42  // alternatively you can also use an
43  // IzhikevichGroup * neuron = new IzhikevichGroup(1);
44 
45  // define current input
46  CurrentInjector * curinject = new CurrentInjector(neuron, "mem");
47 
48  // define monitors
49  SpikeMonitor * smon = new SpikeMonitor( neuron, sys->fn("ras") );
50  VoltageMonitor * vmon = new VoltageMonitor( neuron, 0, sys->fn("mem") );
51  StateMonitor * wmon = new StateMonitor( neuron, 0, "w", sys->fn("w") );
52 
53  // run simulation
54  logger->msg("Running ...",PROGRESS);
55 
56  const double simtime = 0.2;
57  // simulate
58  sys->run(simtime);
59 
60  // simulate current steps of increasing size
61  for ( int i = 0 ; i < 10 ; ++i ) {
62  // turn current on
63  curinject->set_current(0,1.0*i); // current is in arbitrary units
64 
65  // simulate
66  sys->run(simtime);
67 
68  // turn current off
69  curinject->set_current(0,0.0);
70 
71  // simulate
72  sys->run(simtime);
73  }
74 
75  if (errcode)
76  auryn_abort(errcode);
77 
78  logger->msg("Freeing ...",PROGRESS,true);
79  auryn_free();
80  return errcode;
81 }
void auryn_free()
Cleanly shuts down Auryn simulation environment.
Definition: auryn_global.cpp:107
void set_current(NeuronID i, AurynFloat current)
Sets current strengh for neuron i.
Definition: CurrentInjector.cpp:62
Stimulator class to add values in each timestep to arbitrary neuronal states.
Definition: CurrentInjector.h:49
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
Conductance based Adaptive Exponential neuron model - Brette and Gerstner (2005). ...
Definition: AdExGroup.h:46
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
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: