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

Example simulation which simulates one Poisson input with short-term plasticity onto a single postsynaptic neuron and records the membrane potential. More...

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

Macros

#define N   1
 

Functions

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

Detailed Description

Example simulation which simulates one Poisson input with short-term plasticity onto a single postsynaptic neuron and records the membrane potential.

As opposed to sim_epsp.cpp this examples uses a connection with short-term plasticity (Tsodyks Markram model) which is implemented in STPConnection.

Macro Definition Documentation

◆ N

#define N   1

Function Documentation

◆ main()

int main ( int  ac,
char *  av[] 
)
39 {
40 
41  int errcode = 0;
42  char strbuf [255];
43  string outputfile = "out_epsp_stp";
44  string tmpstr;
45  AurynWeight w = 1.0;
46 
47  // BEGIN Global definitions
48  auryn_init( ac, av );
49  sys->set_simulation_name(outputfile);
50  // END Global definitions
51 
52  // Sets up a single presynaptic Poisson neuron which fires at 1Hz
53  PoissonGroup * poisson = new PoissonGroup(N,1.);
54 
55  // Sets up a single postsynaptic integrate-and-fire neuron
56  IFGroup * neuron = new IFGroup(1);
57 
58 
59  // Initializes the STP connection
60  STPConnection * con = new STPConnection(poisson,neuron,w,1.0,GLUT);
61 
62  // Sets STP parameters (depression dominated)
63  double U = 0.2;
64  double taud = 200e-3; // s
65  double tauf = 50e-3; // s
66 
67  // Passes the parameters to the connection instance
68  con->set_tau_d(taud);
69  con->set_tau_f(tauf);
70  con->set_ujump(U);
71 
72 
73  // Sets up recording
74 
75  // Records the input spike train
76  tmpstr = outputfile;
77  tmpstr += ".ras";
78  SpikeMonitor * smon = new SpikeMonitor( poisson, tmpstr.c_str() );
79 
80  // Records the postsynaptic membrane potential
81  tmpstr = outputfile;
82  tmpstr += ".mem";
83  VoltageMonitor * vmon = new VoltageMonitor( neuron, 0, tmpstr.c_str() );
84 
85  // Records the postsynaptic AMPA conductance
86  tmpstr = outputfile;
87  tmpstr += ".ampa";
88  StateMonitor * amon = new StateMonitor( neuron, 0, "g_ampa", tmpstr.c_str() );
89 
90  // Records the postsynaptic NMDA conductance
91  tmpstr = outputfile;
92  tmpstr += ".nmda";
93  StateMonitor * nmon = new StateMonitor( neuron, 0, "g_nmda", tmpstr.c_str() );
94 
95  // simulate for 5s
96  logger->msg("Running ...",PROGRESS);
97  sys->run(5);
98 
99  // Changes firing rate of PoissonGroup
100  poisson->set_rate(50.0);
101 
102  // simulate for 0.5s
103  sys->run(0.5);
104 
105  // Changes firing rate of PoissonGroup
106  poisson->set_rate(1.0);
107 
108  // simulate for 4.5s
109  sys->run(4.5);
110 
111 
112  if (errcode)
113  auryn_abort(errcode);
114 
115  logger->msg("Freeing ...",PROGRESS,true);
116  auryn_free();
117 
118  return errcode;
119 }
void set_tau_d(AurynFloat taud)
Definition: STPConnection.cpp:180
void auryn_free()
Cleanly shuts down Auryn simulation environment.
Definition: auryn_global.cpp:107
#define N
Definition: sim_epsp_stp.cpp:23
Standard Glutamatergic (excitatory) transmission.
Definition: auryn_definitions.h:139
void set_tau_f(AurynFloat tauf)
Definition: STPConnection.cpp:176
AurynFloat AurynWeight
Unit of synaptic weights.
Definition: auryn_definitions.h:159
void set_ujump(AurynFloat r)
Definition: STPConnection.cpp:184
Logger * logger
Global pointer to instance of Logger which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:36
void set_simulation_name(std::string name)
Sets the simulation name.
Definition: System.cpp:654
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
This class implements short term plasticity according to the Tsodyks-Markram synapse.
Definition: STPConnection.h:48
System * sys
Global pointer to instance of System which needs to be initialized in every simulation main program...
Definition: auryn_global.cpp:37
A SpikingGroup that creates poissonian spikes with a given rate.
Definition: PoissonGroup.h:52
Records the membrane potential from one unit from the source neuron group to a file.
Definition: VoltageMonitor.h:48
void set_rate(AurynDouble rate)
Definition: PoissonGroup.cpp:60
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
Records from an arbitray state vector of one unit from the source SpikingGroup to a file...
Definition: StateMonitor.h:40
Implements the standard integrate and file model used in Auryn.
Definition: IFGroup.h:47
Here is the call graph for this function: