SiReNe Simulation Software  1.0
Sirene.h File Reference

Main inlcude file of the SiReNe Software. More...

#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <sys/time.h>
#include <vector>
#include "GenLib.h"
Include dependency graph for Sirene.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SpikeEvent
 Description of a spike event. More...
 
struct  Neuron
 Description of a neuron. More...
 
struct  NeuralModel
 Description of a neural model containing neurons of the same type. More...
 
struct  SynapseModel
 Description of a synaptic model. More...
 
struct  Simul
 Description of an entire simulation. More...
 

Macros

#define omp_get_thread_num()   0
 Alias to OpenMP function returning the thread number. More...
 
#define omp_get_num_threads()   1
 Alias to OpenMP function returning the number of threads. More...
 
#define QUIET   0
 Flag for minimal display in initialization. More...
 
#define VERBOSE_CONFIG   1
 Flag for configuration display in initialization. More...
 
#define VERBOSE_DETAILS   2
 Flag for detailed network display in initialization. More...
 
#define VERBOSE_TIME   4
 Flag for execution time display after simulation. More...
 
#define NO_RECORD   0
 0000000B flag value for no saving during the simulation More...
 
#define SAVE_POTENTIALS   1
 0000001B flag value for saving the potentials during the simulation More...
 
#define SAVE_VARIABLES   2
 0000010B flag value for saving the variables during the simulation More...
 
#define SAVE_INPUT_CURRENTS   4
 0000100B flag value for saving the input currents during the simulation More...
 
#define SAVE_SYNAPTIC_CURRENTS   8
 0001000B flag value for saving the synaptic currents during the simulation More...
 
#define SAVE_LFP   16
 0010000B flag value for saving the LFP during the simulation More...
 
#define SAVE_SPIKES   32
 0100000B flag value for saving the spike times and locations during the simulation More...
 
#define SAVE_NBSPIKES   64
 1000000B flag value for saving the number of spikes during the simulation More...
 
#define BUFFER_SIZE   1000000
 Spikes buffer size. More...
 
#define NBMEMSTEP   2
 Number of stored time steps. More...
 
#define MAXTHREADS   128
 Max number of threads. More...
 
#define INPUT_CALL(chrono)
 Macro to be placed at the beginning of each function requiring execution time profiling (empty macro when time profiling is not activated) More...
 
#define RETURN_CALL(chrono, cumul)
 Macro to be placed at the end of each function requiring execution time profiling (empty macro when time profiling is not activated) More...
 

Enumerations

enum  SynapticCurrentType { EXP_CURRENT =0, EXP_CURRENT_WITH_NOISE }
 Synaptic current types: exponential model wo/w noise (may be extended with other types of synaptic currents) More...
 
enum  InterpolatorType { NO_INTERP =0, LINEAR_INTERP, BEZIER_INTERP }
 Spike interpolation type: NO_INTERP=Spike at time step, LINEAR_INTERP=Lines, BEZIER_INTERP=Quadratic Bézier curve. More...
 

Functions

void Iter (Simul *Simulation, double *TmpVar, double *TmpDer)
 Computation of one time-step from (t) to (t + dt) More...
 
void Advance (Simul *Simulation)
 Simulation process over time-steps. More...
 
void InitSimu (Simul *Simulation)
 Initialization of the simulation structure. More...
 
void PrepareSimu (Simul *Simulation, ushort VerboseMask, ushort SaveMask, int ResultsInterval)
 Preparation of simulation data according to the neural network description. More...
 

Detailed Description

Data structures and main functions to simulate biological neuronal networks with adjustable properties (normal state, Parkinson's disease,...).

Macro Definition Documentation

◆ BUFFER_SIZE

#define BUFFER_SIZE   1000000

◆ INPUT_CALL

#define INPUT_CALL (   chrono)

◆ MAXTHREADS

#define MAXTHREADS   128

◆ NBMEMSTEP

#define NBMEMSTEP   2

◆ NO_RECORD

#define NO_RECORD   0

◆ omp_get_num_threads

#define omp_get_num_threads ( )    1

◆ omp_get_thread_num

#define omp_get_thread_num ( )    0

◆ QUIET

#define QUIET   0

◆ RETURN_CALL

#define RETURN_CALL (   chrono,
  cumul 
)

◆ SAVE_INPUT_CURRENTS

#define SAVE_INPUT_CURRENTS   4

◆ SAVE_LFP

#define SAVE_LFP   16

◆ SAVE_NBSPIKES

#define SAVE_NBSPIKES   64

◆ SAVE_POTENTIALS

#define SAVE_POTENTIALS   1

◆ SAVE_SPIKES

#define SAVE_SPIKES   32

◆ SAVE_SYNAPTIC_CURRENTS

#define SAVE_SYNAPTIC_CURRENTS   8

◆ SAVE_VARIABLES

#define SAVE_VARIABLES   2

◆ VERBOSE_CONFIG

#define VERBOSE_CONFIG   1

◆ VERBOSE_DETAILS

#define VERBOSE_DETAILS   2

◆ VERBOSE_TIME

#define VERBOSE_TIME   4

Enumeration Type Documentation

◆ InterpolatorType

Enumerator
NO_INTERP 
LINEAR_INTERP 
BEZIER_INTERP 

◆ SynapticCurrentType

Enumerator
EXP_CURRENT 
EXP_CURRENT_WITH_NOISE 

Function Documentation

◆ Advance()

◆ InitSimu()

◆ Iter()

void Iter ( Simul Simulation,
double *  TmpVar,
double *  TmpDer 
)

Network state is computed at (t + dt) using a numerical method (Euler or Runge-Kutta 2).
Detection of spikes using the SpikeDetection() function.

Parameters
SimulationStructure where all simulation information is stored
TmpVarVariables array for intermediate time-steps computed in the numerical method
TmpDerDerivatives array for intermediate time-steps computed in the numerical method

References Simul::Chrono_Iter, Simul::CrtNum, INPUT_CALL, Simul::NumericalMethod, Simul::PrvNum, RETURN_CALL, SpikeDetection(), Simul::t, Simul::Time_Iter, Simul::TimeStep, and UpdateModels().

Referenced by Advance().

◆ PrepareSimu()

void PrepareSimu ( Simul Simulation,
ushort  VerboseMask,
ushort  SaveMask,
int  ResultsInterval 
)

Initialization of:

  • Simulation structure:
    • SaveMask for data saving during the simulation
    • Time index PrvNum (previous time-step)
    • Crt (current time-step)
    • Time t0 = simulation starting point
    • Total number of neurons
    • Number of variables
    • Allocation of the variables array
    • Allocation of the derivatives of the variables array
    • Sum of the LFP
  • Neuron structure:
    • Input/Synaptic current
    • Global number neuron
    • Number of parameters
    • Parameters
    • Synaptic current factor
    • Spike threshold
    • Potential index
    • Mid-time step potential
    • Mid-time step derivative of the potential
    • Number of spikes
    • Last spike time
  • Message:
    • Display of initialization information
      • Initialization display is activated via the VerboseMask parameter
  • Chrono:
    • Time initalization for each function
Parameters
SimulationStructure where all simulation information is stored
VerboseMaskMask of information to display
SaveMaskMask of variables to save to file
ResultsIntervalNumber of iterations between results display / save

References BUFFER_SIZE, Simul::BufferSpikes, Simul::Chrono_Init, Simul::ChronoStart, Simul::CrtNum, Simul::DVar, Neuron::dVMidStep, NeuralModel::FirstNeuronNumber, Neuron::GlobalNumNeuron, Neuron::InitialValues, INPUT_CALL, Neuron::InputCurrent, Neuron::LastSpikeTime, MAXTHREADS, MYMALLOC(), NBMEMSTEP, Simul::NbSpInBuf, Simul::NbThreads, NeuralModelPrint(), Simul::NeuralModels, NeuronPrint(), NeuralModel::Neurons, Simul::NumberNeuralModels, SynapseModel::NumberOfConnections, NeuralModel::NumberOfNeurons, Neuron::NumberOfParameters, NeuralModel::NumberOfParameters, Neuron::NumberOfSpikes, NeuralModel::NumberOfVariables, Simul::NumberOfVariables, Neuron::Parameters, NeuralModel::Parameters, Neuron::PotentialIndex, Simul::PrvNum, Simul::ResultsInterval, RETURN_CALL, Simul::SaveMask, Simul::sLFP, Neuron::SpikeTreshold, NeuralModel::SpikeTreshold, Simul::Start, SynapseModelPrint(), Simul::SynapseModels, Neuron::SynapticCurrent, Neuron::SynCurrentFactor, Simul::t, Simul::Time_Advance, Simul::Time_Detection, Simul::Time_Init, Simul::Time_Iter, Simul::Time_NumericalMethod, Simul::Time_RandGenConn, Simul::Time_SpikeProcessing, Simul::Time_UpdateModels, Simul::Time_UpdateNeuron, Simul::TimeStep, Simul::TotalNumberOfNeurons, Simul::TotalTimeSim, Simul::Variables, VERBOSE_CONFIG, VERBOSE_DETAILS, Simul::VerboseMask, and Neuron::VMidStep.

Referenced by main().