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

Example simulation which simulates a neuron during current step injection. More...

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

Macros

#define N   1
 

Functions

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

Detailed Description

Example simulation which simulates a neuron during current step injection.

Macro Definition Documentation

◆ N

#define N   1

Function Documentation

◆ main()

int main ( int  ac,
char *  av[] 
)
35 {
36 
37  int errcode = 0;
38  char strbuf [255];
39  string simname = "step_current";
40  string tmpstr;
41  AurynWeight w = 1.0;
42 
43  auryn_init(ac, av);
44 
45  // define neuron group
46  IzhikevichGroup * neuron = new IzhikevichGroup(1);
47 
48  // define current input
49  CurrentInjector * curinject = new CurrentInjector(neuron, "mem");
50 
51  // define monitors
52  SpikeMonitor * smon = new SpikeMonitor( neuron, sys->fn("ras") );
53  StateMonitor * vmon = new StateMonitor( neuron, 0, "mem", sys->fn("mem") );
54 
55  // run simulation
56  logger->msg("Running ...",PROGRESS);
57 
58  // simulate 1 second
59  sys->run(0.1);
60 
61  // turn current on
62  curinject->set_current(0,10.0);
63 
64  // simulate 1 second
65  sys->run(0.1);
66 
67  if (errcode)
68  auryn_abort(errcode);
69 
70  // clean up
71  logger->msg("Freeing ...",PROGRESS,true);
72  auryn_free();
73 
74  return errcode;
75 }
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
This NeuronGroup implements the Izhikevich neuron model with conductance based AMPA and GABA synapses...
Definition: IzhikevichGroup.h:52
AurynFloat AurynWeight
Unit of synaptic weights.
Definition: auryn_definitions.h:159
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
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: