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

Example simulation which simulates one Poisson input onto a single postsynaptic neuron and records the membrane potential. More...

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

Macros

#define N   1000
 

Functions

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

Detailed Description

Example simulation which simulates one Poisson input onto a single postsynaptic neuron and records the membrane potential.

Macro Definition Documentation

◆ N

#define N   1000

Function Documentation

◆ main()

int main ( int  ac,
char *  av[] 
)
35 {
36 
37  int errcode = 0;
38  string simname = "stim_group";
39  string logfile = simname;
40  string tmpstr;
41  AurynWeight w = 1.0;
42 
43  // BEGIN Global definitions
44  auryn_init( ac, av );
45  sys->set_simulation_name(simname);
46  // END Global definitions
47 
48  // define input group
49  StimulusGroup * stimgroup = new StimulusGroup(N, "stim_group.pat", "stim_group.stim", RANDOM);
50  stimgroup->set_mean_on_period(5.0);
51  stimgroup->set_mean_off_period(5.0);
52  stimgroup->set_baserate(5.0);
53  stimgroup->binary_patterns = true;
54  stimgroup->scale = 10.0;
55  stimgroup->background_rate = 1.0;
56  stimgroup->background_during_stimulus = true;
57 
58 
59  // define monitors
60  SpikeMonitor * smon = new SpikeMonitor( stimgroup, sys->fn("ras") );
61 
62  // run simulation
63  logger->msg("Running ...",PROGRESS);
64  sys->run(50);
65 
66  if (errcode)
67  auryn_abort(errcode);
68 
69  logger->msg("Freeing ...",PROGRESS,true);
70  auryn_free();
71  return errcode;
72 }
void auryn_free()
Cleanly shuts down Auryn simulation environment.
Definition: auryn_global.cpp:107
Definition: auryn_definitions.h:148
void set_mean_on_period(AurynFloat period)
Set mean on period.
Definition: StimulusGroup.cpp:156
void set_baserate(AurynFloat baserate)
Sets the baserate that is the rate at 1 activity.
Definition: StimulusGroup.cpp:138
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
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
#define N
Definition: sim_stim_group.cpp:23
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
Provides a poisson stimulus at random intervals in one or more predefined subsets of the group that a...
Definition: StimulusGroup.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
bool binary_patterns
Switches to more efficient algorithm which ignores the gamma value.
Definition: StimulusGroup.h:151
Definition: Logger.h:41
string fn(std::string extension)
Format output file name.
Definition: System.cpp:689
AurynDouble background_rate
Play random Poisson noise with this rate on all channels when no stim is active.
Definition: StimulusGroup.h:164
bool background_during_stimulus
Switch for background firing during stimulus.
Definition: StimulusGroup.h:167
void set_mean_off_period(AurynFloat period)
Set mean quiet interval between consecutive stimuli.
Definition: StimulusGroup.cpp:150
AurynFloat scale
This is by how much the pattern gamma value is multiplied. The resulting value gives the x-times base...
Definition: StimulusGroup.h:148
Here is the call graph for this function: