examples:sim_epsp
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
examples:sim_epsp [2014/01/10 19:10] – created zenke | examples:sim_epsp [2016/08/11 07:37] (current) – Removes full prog zenke | ||
---|---|---|---|
Line 24: | Line 24: | ||
In the default configuration of the simulation the [[manual: | In the default configuration of the simulation the [[manual: | ||
- | ===== Output example | + | ==== Output example ==== |
This plot shows the membrane potential of the single neuron in the simulation. | This plot shows the membrane potential of the single neuron in the simulation. | ||
- | {{ :manual:epsp.png |}} | + | {{ :examples:epsp.png?300 |}} |
This plot can be generated by running gnuplot and issueing the follwing commands in the same directory | This plot can be generated by running gnuplot and issueing the follwing commands in the same directory | ||
Line 39: | Line 39: | ||
===== The importand bits ===== | ===== The importand bits ===== | ||
- | --- todo // | ||
- | ===== The full program ===== | ||
<code c++> | <code c++> | ||
- | /* | + | PoissonGroup |
- | * Copyright 2014 Friedemann Zenke | + | PoissonGroup |
- | * | + | IFGroup |
- | * This file is part of Auryn, a simulation package for plastic | + | </ |
- | * spiking neural networks. | + | Sets up the two Poisson neurons (two groups containing a single Poisson cell each) and a single integrate-and-fire cell from the [[manual:IFGroup]] type. |
- | * | + | |
- | * Auryn is free software: you can redistribute it and/or modify | + | |
- | * it under the terms of the GNU General Public License as published by | + | |
- | * the Free Software Foundation, either version 3 of the License, or | + | |
- | * (at your option) any later version. | + | |
- | * | + | |
- | * Auryn is distributed in the hope that it will be useful, | + | |
- | * but WITHOUT ANY WARRANTY; without even the implied warranty of | + | |
- | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | + | |
- | * GNU General Public License for more details. | + | |
- | * | + | |
- | * You should have received | + | |
- | * along with Auryn. | + | |
- | */ | + | |
- | # | + | <code cpp> |
- | # | + | IdentityConnection * con = new IdentityConnection(poisson, |
- | #include <stdlib.h> | + | IdentityConnection * con2 = new IdentityConnection(poisson2, |
- | #include < | + | </code> |
+ | Creates two one-to-one connetions between the Poisson neurons and the integrate-and-fire cell. | ||
- | # | + | <code> |
- | #include < | + | SpikeMonitor * smon = new SpikeMonitor( neuron, tmpstr.c_str() ); |
- | # | + | </code> |
- | #include < | + | Sets up a [[manual: |
- | #include " | + | < |
- | #include " | + | VoltageMonitor * vmon = new VoltageMonitor( neuron, 0, tmpstr.c_str() ); |
- | #include " | + | </ |
- | #include " | + | Creates a [[manual:VoltageMonitor]] that records the voltage to a different file which is again specified in '' |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include "VoltageMonitor.h" | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #include " | + | |
- | #define N 1 | ||
- | using namespace std; | + | <code c++> |
- | + | logger-> | |
- | namespace po = boost:: | + | sys-> |
- | namespace mpi = boost:: | + | |
- | + | ||
- | int main(int ac, char* av[]) | + | |
- | { | + | |
- | + | ||
- | int errcode = 0; | + | |
- | char strbuf [255]; | + | |
- | string outputfile = " | + | |
- | string tmpstr; | + | |
- | AurynWeight w = 1.0; | + | |
- | + | ||
- | // BEGIN Global definitions | + | |
- | mpi:: | + | |
- | mpi:: | + | |
- | communicator = & | + | |
- | + | ||
- | sprintf(strbuf, | + | |
- | string logfile = strbuf; | + | |
- | logger = new Logger(logfile, | + | |
- | + | ||
- | sys = new System(& | + | |
- | // END Global definitions | + | |
- | + | ||
- | PoissonGroup * poisson = new PoissonGroup(N, | + | |
- | PoissonGroup * poisson2 = new PoissonGroup(N, | + | |
- | IFGroup * neuron = new IFGroup(1); | + | |
- | + | ||
- | IdentityConnection * con = new IdentityConnection(poisson, | + | |
- | IdentityConnection * con2 = new IdentityConnection(poisson2, | + | |
- | + | ||
- | tmpstr = outputfile; | + | |
- | tmpstr | + | |
- | SpikeMonitor * smon = new SpikeMonitor( neuron, tmpstr.c_str() ); | + | |
- | + | ||
- | tmpstr = outputfile; | + | |
- | tmpstr | + | |
- | VoltageMonitor * vmon = new VoltageMonitor( neuron, 0, tmpstr.c_str() ); | + | |
- | + | ||
- | tmpstr = outputfile; | + | |
- | tmpstr += " | + | |
- | AmpaMonitor * amon = new AmpaMonitor( neuron, 0, tmpstr.c_str() ); | + | |
- | + | ||
- | tmpstr = outputfile; | + | |
- | tmpstr += " | + | |
- | GabaMonitor * gmon = new GabaMonitor( neuron, 0, tmpstr.c_str() ); | + | |
- | + | ||
- | tmpstr = outputfile; | + | |
- | tmpstr += " | + | |
- | NmdaMonitor * nmon = new NmdaMonitor( neuron, 0, tmpstr.c_str() ); | + | |
- | + | ||
- | logger-> | + | |
- | sys-> | + | |
- | + | ||
- | logger-> | + | |
- | delete sys; | + | |
- | + | ||
- | if (errcode) | + | |
- | env.abort(errcode); | + | |
- | return errcode; | + | |
- | } | + | |
</ | </ | ||
+ | This finally outputs a message '' | ||
examples/sim_epsp.1389381015.txt.gz · Last modified: 2014/01/10 19:10 by zenke