00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _LEAKY_H_
00024 #define _LEAKY_H_
00025
00026 #include "neuron.h"
00027
00042 typedef struct {
00043 aspi_neuron_t parent;
00044
00045 double * futur_voltages_exci;
00046 double * futur_voltages_inhib;
00047
00048 int max_delay;
00049
00050 int vindex;
00051
00052 int * last_spike;
00053
00054 double * v_traces;
00055
00056 int memory;
00057
00058 int index;
00059
00060 double freq;
00061
00062 double threshold;
00063
00064 double std_dev_ip_init;
00065 double std_dev_ip_current;
00066
00067 aspi_object_t * network;
00068 double v_mem[100];
00069 } aspi_leaky_t;
00070
00071
00075 typedef struct {
00076 aspi_neuron_class_t parent;
00077 } aspi_leaky_class_t;
00078
00079
00080 aspi_class_t * aspi_leaky (void);
00081
00082
00083 aspi_object_t * aspi_leaky_init (aspi_object_t * self);
00084 aspi_object_t * aspi_leaky_init_full (aspi_object_t * self, int memory, int delay);
00085 void aspi_leaky_dtor (aspi_object_t * self);
00086 aspi_object_t * aspi_leaky_dup (aspi_object_t * self);
00087
00088 void aspi_leaky_set_memory (aspi_object_t * self, int memory);
00089 void aspi_leaky_set_max_delay (aspi_object_t * self, int delay);
00090 void aspi_leaky_add_in_n_steps (aspi_object_t * self, double voltages, int steps);
00091 void aspi_leaky_update_voltage (aspi_object_t * self);
00092 void aspi_leaky_set_threshold (aspi_object_t * self, double threshold);
00093 double aspi_leaky_get_threshold (aspi_object_t * self);
00094 double aspi_leaky_get_threshold_ip (aspi_object_t * self);
00095 int aspi_leaky_get_last_spike (aspi_object_t * self);
00096 int aspi_leaky_get_last_spike_before (aspi_object_t * self, int before);
00097 double aspi_leaky_get_v_trace (aspi_object_t * self);
00098 double aspi_leaky_get_v_trace_at (aspi_object_t * self, int time);
00099
00100 void aspi_leaky_set_last_spike (aspi_object_t * self, int time);
00101 void aspi_leaky_fire (aspi_object_t * self);
00102 int aspi_leaky_has_fired (aspi_object_t * self);
00103 int aspi_leaky_has_fired_at (aspi_object_t * self, int time);
00104 double aspi_leaky_get_voltage (aspi_object_t * self);
00105 double aspi_leaky_get_freq (aspi_object_t * self);
00106
00107
00108
00109 void aspi_leaky_class_set_rest_voltage (double rest);
00110 void aspi_leaky_class_set_noise (double noise);
00111 void aspi_leaky_class_set_leak (double leak);
00112 void aspi_leaky_class_set_refractory (int refractory);
00113 int aspi_leaky_class_get_refractory (void);
00114 void aspi_leaky_class_set_threshold (double threshold);
00115 void aspi_leaky_class_set_threshold_leak (double leak);
00116 void aspi_leaky_class_set_dynamic_threshold (int dynamic_threshold);
00117 double aspi_leaky_class_get_threshold (void);
00118 void aspi_leaky_class_set_stp (int set_stp);
00119 void aspi_leaky_class_set_ip (int set_ip);
00120 void aspi_leaky_class_set_ip_factor (double ip_factor);
00121 void aspi_neuron_class_set_reversal_potential (int set_reversal_potential);
00122 void aspi_neuron_class_set_reversal_potentials (double rev_pot_exci, double rev_pot_inhib);
00123
00124
00125
00126
00127 #define ASPI_LEAKY(x) (aspi_object_check (x, aspi_leaky ()), ((aspi_leaky_t *) x))
00128 #define ASPI_LEAKY_CLASS(x) (aspi_class_check (x, aspi_leaky ()), ((aspi_leaky_class_t * ) x))
00129
00132 #endif