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

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

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

Functions

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

Detailed Description

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

Function Documentation

◆ main()

int main ( int  ac,
char *  av[] 
)
33 {
34  int errcode = 0;
35  char strbuf [255];
36  string simname = "nbg";
37  auryn_init( ac, av, ".", simname );
38 
39  // define neuron group
40  NaudGroup* neuron = new NaudGroup(1);
41 
42  // define current input
43  CurrentInjector * curr_inject1 = new CurrentInjector(neuron, "mem");
44  CurrentInjector * curr_inject2 = new CurrentInjector(neuron, "Vd");
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 * smon_vd = new StateMonitor( neuron, 0, "Vd", sys->fn("Vd") );
50  StateMonitor * smon_m = new StateMonitor( neuron, 0, "thr", sys->fn("thr") );
51  StateMonitor * smon_ws = new StateMonitor( neuron, 0, "wsoma", sys->fn("wsoma") );
52 
53  // run simulation
54  logger->msg("Running ...",PROGRESS);
55 
56  const double simtime = 200e-3;
57  // simulate
58  sys->run(simtime);
59 
60  // simulate current steps of increasing size
61  const float s0 = 0.2;
62  for ( int i = 0 ; i < 16 ; ++i ) {
63  // turn current on
64  // if ( i%3 == 0 ) {
65  // curr_inject1->set_current(0,-s0*i); // current is in arbitrary units
66  // }
67 
68  // if ( i%3 == 1 ) {
69  // curr_inject2->set_current(0,-s0*i); // current is in arbitrary units
70  // }
71 
72  if ( i%3 == 2 ) {
73  curr_inject1->set_current(0,s0*i); // current is in arbitrary units
74  curr_inject2->set_current(0,s0*i); // current is in arbitrary units
75  }
76 
77  // simulate
78  sys->run(simtime);
79 
80  // turn current off
81  curr_inject1->set_current(0,0.0);
82  curr_inject2->set_current(0,0.0);
83 
84  // simulate
85  sys->run(2*simtime);
86  }
87 
88  sys->run(5);
89 
90  if (errcode)
91  auryn_abort(errcode);
92 
93  logger->msg("Freeing ...",PROGRESS,true);
94  auryn_free();
95  return errcode;
96 }
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
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
This file implements NaudGroup, Richard Naud&#39;s reduced two compartment model with active dendrites...
Definition: NaudGroup.h:50
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: