forked from dbbs-lab/cereb-nest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eglif_cond_alpha_multisyn.h
1460 lines (961 loc) · 42.5 KB
/
eglif_cond_alpha_multisyn.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* generated by template org.nest.nestml.neuron.NeuronHeader*/
/*
* eglif_cond_alpha_multisyn.h
*
* This file is part of NEST.
*
* Copyright (C) 2004 The NEST Initiative
*
* NEST 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 2 of the License, or
* (at your option) any later version.
*
* NEST 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. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NEST. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef EGLIF_COND_ALPHA_MULTISYN
#define EGLIF_COND_ALPHA_MULTISYN
#include "config.h"
#ifdef HAVE_GSL
#include <gsl/gsl_errno.h>
#include <gsl/gsl_matrix.h>
#include <gsl/gsl_odeiv.h>
// forwards the declaration of the function
extern "C" inline int
eglif_cond_alpha_multisyn_dynamics(double, const double y[], double f[],
void *pnode);
/*
extern "C" inline int
eglif_cond_alpha_multisyn_dynamics(double, const double*, double*,
void *pnode);*/
// Includes from nestkernel:
#include "archiving_node.h"
#include "connection.h"
#include "event.h"
#include "nest_types.h"
#include "ring_buffer.h"
#include "universal_data_logger.h"
// Includes from sli:
#include "dictdatum.h"
/* BeginDocumentation
Name: eglif_cond_alpha_multisyn .
//
Name: eglif_cond_alpha_multisyn_nestml - Extended Generalized Leaky
integrate-and-fire neuron model with multiple ports based. Described in [Geminiani et al., Front Neuroinf, 2018].
Description (NESTML):
eglif_cond_alpha_multisyn_nestml from iaf_psc_exp_multisynapse_nestml.
With respect to first model version, a minimum value of Vm is added here, useful in case of oscillatory solutions
Sends: SpikeEvent
Receives: SpikeEvent, CurrentEvent, DataLoggingRequest
Author: Geminiani Alice
Casellato Claudia, adapted from iaf_psc_exp_multisynapse and iaf_psc_alpha_multisyn and iaf_cond_alpha for the synapses;
Contact: [email protected]
//
Parameters:
Remarks:
Empty
References:
Empty
Sends: nest::SpikeEvent
Receives: Spike, Current, DataLoggingRequest
SeeAlso:
Empty
*/
class eglif_cond_alpha_multisyn : public nest::Archiving_Node {
public:
/**
* The constructor is only used to create the model prototype in the model
* manager.
*/
eglif_cond_alpha_multisyn();
/**
* The copy constructor is used to create model copies and instances of the
* model.
* @node The copy constructor needs to initialize the parameters and the state.
* Initialization of buffers and interal variables is deferred to
* @c init_buffers_() and @c calibrate().
*/
eglif_cond_alpha_multisyn(const eglif_cond_alpha_multisyn &);
/**
* Releases resources.
*/
~eglif_cond_alpha_multisyn();
/**
* Import sets of overloaded virtual functions.
* This is necessary to ensure proper overload and overriding resolution.
* @see http://www.gotw.ca/gotw/005.htm.
*/
using nest::Node::handles_test_event;
using nest::Node::handle;
/**
* Used to validate that we can send nest::SpikeEvent to desired target:port.
*/
nest::port send_test_event(nest::Node &target, nest::rport receptor_type,
nest::synindex, bool);
/**
* @defgroup mynest_handle Functions handling incoming events.
* We tell nest that we can handle incoming events of various types by
* defining @c handle() and @c connect_sender() for the given event.
* @{
*/
void handle(nest::SpikeEvent &); //! accept spikes
void handle(nest::CurrentEvent &); //! accept input current
void handle(nest::DataLoggingRequest &); //! allow recording with multimeter
nest::port handles_test_event(nest::SpikeEvent &, nest::port);
nest::port handles_test_event(nest::CurrentEvent &, nest::port);
nest::port handles_test_event(nest::DataLoggingRequest &, nest::port);
/** @} */
// SLI communication functions:
void get_status(DictionaryDatum &) const;
void set_status(const DictionaryDatum &);
// Generate function header
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_I_dep() const { return S_.y_[State_::I_dep]; }
inline void set_I_dep(const double v) { S_.y_[State_::I_dep] = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_I_adap() const { return S_.y_[State_::I_adap]; }
inline void set_I_adap(const double v) { S_.y_[State_::I_adap] = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_V_m() const { return S_.y_[State_::V_m]; }
inline void set_V_m(const double v) { S_.y_[State_::V_m] = v; }
/* Conductance-based synapses for the 4 receptors*/
inline double get_G1() const { return S_.y_[State_::G1]; }
inline void set_G1(const double v) { S_.y_[State_::G1] = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_DG1() const { return S_.y_[State_::DG1]; }
inline void set_DG1(const double v) { S_.y_[State_::DG1] = v; }
inline double get_G2() const { return S_.y_[State_::G2]; }
inline void set_G2(const double v) { S_.y_[State_::G2] = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_DG2() const { return S_.y_[State_::DG2]; }
inline void set_DG2(const double v) { S_.y_[State_::DG2] = v; }
inline double get_G3() const { return S_.y_[State_::G3]; }
inline void set_G3(const double v) { S_.y_[State_::G3] = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_DG3() const { return S_.y_[State_::DG3]; }
inline void set_DG3(const double v) { S_.y_[State_::DG3] = v; }
inline double get_G4() const { return S_.y_[State_::G4]; }
inline void set_G4(const double v) { S_.y_[State_::G4] = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_DG4() const { return S_.y_[State_::DG4]; }
inline void set_DG4(const double v) { S_.y_[State_::DG4] = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_C_m() const { return P_.C_m; }
inline void set_C_m(const double v) { P_.C_m = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_tau_m() const { return P_.tau_m; }
inline void set_tau_m(const double v) { P_.tau_m = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_tau_syn1() const { return P_.tau_syn1; }
inline void set_tau_syn1(const double v) { P_.tau_syn1 = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_E_rev1() const { return P_.E_rev1; }
inline void set_E_rev1(const double v) { P_.E_rev1 = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_tau_syn2() const { return P_.tau_syn2; }
inline void set_tau_syn2(const double v) { P_.tau_syn2 = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_E_rev2() const { return P_.E_rev2; }
inline void set_E_rev2(const double v) { P_.E_rev2 = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_tau_syn3() const { return P_.tau_syn3; }
inline void set_tau_syn3(const double v) { P_.tau_syn3 = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_E_rev3() const { return P_.E_rev3; }
inline void set_E_rev3(const double v) { P_.E_rev3 = v; }
inline double get_tau_syn4() const { return P_.tau_syn4; }
inline void set_tau_syn4(const double v) { P_.tau_syn4 = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_E_rev4() const { return P_.E_rev4; }
inline void set_E_rev4(const double v) { P_.E_rev4 = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_t_ref() const { return P_.t_ref; }
inline void set_t_ref(const double v) { P_.t_ref = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_E_L() const { return P_.E_L; }
inline void set_E_L(const double v) { P_.E_L = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_V_reset() const { return P_.V_reset; }
inline void set_V_reset(const double v) { P_.V_reset = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_V_th() const { return P_.V_th; }
inline void set_V_th(const double v) { P_.V_th = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_Vinit() const { return P_.Vinit; }
inline void set_Vinit(const double v) { P_.Vinit = v; }
inline double get_Vmin() const { return P_.Vmin; }
inline void set_Vmin(const double v) { P_.Vmin = v; }
/* Added for stochasticity*/
inline double get_lambda_0() const { return P_.lambda_0; }
inline void set_lambda_0(const double v) { P_.lambda_0 = v; }
inline double get_tau_V() const { return P_.tau_V; }
inline void set_tau_V(const double v) { P_.tau_V = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_k1() const { return P_.k1; }
inline void set_k1(const double v) { P_.k1 = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_k2() const { return P_.k2; }
inline void set_k2(const double v) { P_.k2 = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_A1() const { return P_.A1; }
inline void set_A1(const double v) { P_.A1 = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_A2() const { return P_.A2; }
inline void set_A2(const double v) { P_.A2 = v; }
inline double get_kadap() const { return P_.kadap; }
inline void set_kadap(const double v) { P_.kadap = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_I_e() const { return P_.I_e; }
inline void set_I_e(const double v) { P_.I_e = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline long get_bT_size() const { return P_.bT_size; }
inline void set_bT_size(const long v) { P_.bT_size = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline long get_receptors() const { return V_.receptors; }
inline void set_receptors(const long v) { V_.receptors = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline long get_RefractoryCounts() const { return V_.RefractoryCounts; }
inline void set_RefractoryCounts(const long v) { V_.RefractoryCounts = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline long get_r() const { return V_.r; }
inline void set_r(const long v) { V_.r = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline std::vector<double> get_bufferT() const { return V_.bufferT; }
inline void set_bufferT(const std::vector<double> v) { V_.bufferT = v; }
inline double get_Vth() const { return V_.V_th; }
inline void set_Vth(const double v) { V_.V_th = v; }
inline double get_I_gen() const { return V_.I_gen; }
inline void set_I_gen(const double v) { V_.I_gen = v; }
inline double get_sum_buffer() const { return V_.sum_buffer; }
inline void set_sum_buffer(const double v) { V_.sum_buffer = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_tot_cur() const { return V_.tot_cur; }
inline void set_tot_cur(const double v) { V_.tot_cur = v; }
/* Added for R2 update*/
inline double get_R2() const {return V_.R2; }
inline double set_R2(const double v) {return V_.R2 = v; }
inline double get_old_Vm() const { return V_.old_Vm; }
inline void set_old_Vm(const double v) { V_.old_Vm = v; }
inline double get_new_Vm() const { return V_.new_Vm; }
inline void set_old_new_Vm(const double v) { V_.new_Vm = v; }
inline double get_old_slope() const { return V_.old_slope; }
inline void set_old_slope(const double v) { V_.old_slope = v; }
inline double get_new_slope() const { return V_.new_slope; }
inline void set_new_slope(const double v) { V_.new_slope = v; }
inline std::vector<double> get_G0() const {
return V_.G0;
}
inline void set_G0(const std::vector<double> v) {
V_.G0 = v;
}
inline double get_I_syn() const { return S_.I_syn; }
inline void set_I_syn(const double v) { S_.I_syn = v; }
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
/* generated by template org.nest.nestml.function.MemberVariableGetterSetter*/
inline double get_I_tot() const { return S_.I_tot; }
inline void set_I_tot(const double v) { S_.I_tot = v; }
inline nest::RingBuffer &get_spikes_r1() {
return B_.get_spikes_r1();
};
inline nest::RingBuffer &get_spikes_r2() {
return B_.get_spikes_r2();
};
inline nest::RingBuffer &get_spikes_r3() {
return B_.get_spikes_r3();
};
inline nest::RingBuffer &get_spikes_r4() {
return B_.get_spikes_r4();
};
inline nest::RingBuffer &get_currents() { return B_.get_currents(); };
protected:
//! Reset parameters and state of neuron.
//! Reset state of neuron.
void init_state_(const Node &proto);
//! Reset internal buffers of neuron.
void init_buffers_();
//! Initialize auxiliary quantities, leave parameters and state untouched.
void calibrate();
//! Take neuron through given time interval
void update(nest::Time const &, const long, const long);
// The next two classes need to be friends to access the State_ class/member
friend class nest::RecordablesMap<eglif_cond_alpha_multisyn>;
friend class nest::UniversalDataLogger<eglif_cond_alpha_multisyn>;
/**
* Free parameters of the neuron.
*
*
*
* These are the parameters that can be set by the user through @c SetStatus.
* They are initialized from the model prototype when the node is created.
* Parameters do not change during calls to @c update() and are not reset by
* @c ResetNetwork.
*
* @note Parameters_ need neither copy constructor nor @c operator=(), since
* all its members are copied properly by the default copy constructor
* and assignment operator. Important:
* - If Parameters_ contained @c Time members, you need to define the
* assignment operator to recalibrate all members of type @c Time . You
* may also want to define the assignment operator.
* - If Parameters_ contained members that cannot copy themselves, such
* as C-style arrays, you need to define the copy constructor and
* assignment operator to copy those members.
*/
struct Parameters_ {
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double C_m; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double tau_m; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double tau_syn1; //
/* Conductance-based synapses*/
double E_rev1; //
double tau_syn2; //
/* Conductance-based synapses*/
double E_rev2; //
double tau_syn3; //
/* Conductance-based synapses*/
double E_rev3; //
double tau_syn4;
/* Conductance-based synapses*/
double E_rev4;
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double t_ref; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double E_L; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double V_reset; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double V_th; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double Vinit; //
double Vmin; //
/*Added for stochasticity*/
double lambda_0;
double tau_V;
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double k1; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double k2; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double A1; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double A2; //
double kadap;
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double I_e; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
long bT_size; //
/** Initialize parameters to their default values. */
Parameters_();
/** Set parameter values from dictionary. */
void set(const DictionaryDatum &);
// TODO only for invariants
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_C_m() const { return C_m; }
inline void set_C_m(const double C_m) { this->C_m = C_m; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_tau_m() const { return tau_m; }
inline void set_tau_m(const double tau_m) { this->tau_m = tau_m; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_tau_syn1() const { return tau_syn1; }
inline void set_tau_syn1(const double tau_syn1) {
this->tau_syn1 = tau_syn1;
}
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_E_rev1() const { return E_rev1; }
inline void set_E_rev1(const double E_rev1) {
this->E_rev1 = E_rev1;
}
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_tau_syn2() const { return tau_syn2; }
inline void set_tau_syn2(const double tau_syn2) {
this->tau_syn2 = tau_syn2;
}
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_E_rev2() const { return E_rev2; }
inline void set_E_rev2(const double E_rev2) {
this->E_rev2 = E_rev2;
}
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_tau_syn3() const { return tau_syn3; }
inline void set_tau_syn3(const double tau_syn3) {
this->tau_syn3 = tau_syn3;
}
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_E_rev3() const { return E_rev3; }
inline void set_E_rev3(const double E_rev3) {
this->E_rev3 = E_rev3;
}
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_tau_syn4() const { return tau_syn4; }
inline void set_tau_syn4(const double tau_syn4) {
this->tau_syn4 = tau_syn4;
}
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_E_rev4() const { return E_rev4; }
inline void set_E_rev4(const double E_rev4) {
this->E_rev4 = E_rev4;
}
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_t_ref() const { return t_ref; }
inline void set_t_ref(const double t_ref) { this->t_ref = t_ref; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_E_L() const { return E_L; }
inline void set_E_L(const double E_L) { this->E_L = E_L; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_V_reset() const { return V_reset; }
inline void set_V_reset(const double V_reset) { this->V_reset = V_reset; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_V_th() const { return V_th; }
inline void set_V_th(const double V_th) { this->V_th = V_th; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_Vinit() const { return Vinit; }
inline void set_Vinit(const double Vinit) {
this->Vinit = Vinit;
}
inline double get_Vmin() const { return Vmin; }
inline void set_Vmin(const double Vmin) {
this->Vmin = Vmin;
}
/* Added for stochasticity*/
inline double get_lambda_0() const { return lambda_0; }
inline void set_lambda_0(const double lambda_0) {
this->lambda_0 = lambda_0;
}
inline double get_tau_V() const { return tau_V; }
inline void set_tau_V(const double tau_V) {
this->tau_V = tau_V;
}
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_k1() const { return k1; }
inline void set_k1(const double k1) { this->k1 = k1; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_k2() const { return k2; }
inline void set_k2(const double k2) { this->k2 = k2; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_A1() const { return A1; }
inline void set_A1(const double A1) { this->A1 = A1; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_A2() const { return A2; }
inline void set_A2(const double A2) { this->A2 = A2; }
inline double get_kadap() const { return kadap; }
inline void set_kadap(const double kadap) { this->kadap = kadap; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_I_e() const { return I_e; }
inline void set_I_e(const double I_e) { this->I_e = I_e; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline long get_bT_size() const { return bT_size; }
inline void set_bT_size(const long bT_size) { this->bT_size = bT_size; }
};
/**
* Dynamic state of the neuron.
*
*
*
* These are the state variables that are advanced in time by calls to
* @c update(). In many models, some or all of them can be set by the user
* through @c SetStatus. The state variables are initialized from the model
* prototype when the node is created. State variables are reset by @c
* ResetNetwork.
*
* @note State_ need neither copy constructor nor @c operator=(), since
* all its members are copied properly by the default copy constructor
* and assignment operator. Important:
* - If State_ contained @c Time members, you need to define the
* assignment operator to recalibrate all members of type @c Time . You
* may also want to define the assignment operator.
* - If State_ contained members that cannot copy themselves, such
* as C-style arrays, you need to define the copy constructor and
* assignment operator to copy those members.
*/
struct State_ {
/**
* Enumeration identifying elements in state vector State_::y_.
* This enum identifies the elements of the vector. It must be public to be
* accessible from the iteration function. The last two elements of this
* enum (DG, G) will be repeated
* n times at the end of the state vector State_::y_ with n being the number
* of synapses.
*/
//! Symbolic indices to the elements of the state vector y_
enum StateVecElems {
V_m,
I_dep,
I_adap,
G1,
DG1,
G2,
DG2,
G3,
DG3,
G4,
DG4,
STATE_VEC_SIZE // This is the minimum state vector size
};
//! state vector, must be C-array for GSL solver
double y_[STATE_VEC_SIZE];// - an array of all the state variables undergoing
double time;
double I_syn; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double I_tot; //
State_();
/**
* Set state values from dictionary.
*/
void set(const DictionaryDatum &, const Parameters_ &);
};
/**
* Internal variables of the neuron.
*
*
*
* These variables must be initialized by @c calibrate, which is called before
* the first call to @c update() upon each call to @c Simulate.
* @node Variables_ needs neither constructor, copy constructor or assignment
* operator,
* since it is initialized by @c calibrate(). If Variables_ has members
* that
* cannot destroy themselves, Variables_ will need a destructor.
*/
struct Variables_ {
/* generated by template org.nest.nestml.function.MemberDeclaration*/
librandom::RngPtr rng_; // random number generator of my own thread
long RefractoryCounts; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
long r; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
long receptors; // Number of receptors
std::vector<double> G0; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
std::vector<double> bufferT; //
/* generated by template org.nest.nestml.function.MemberDeclaration*/
double tot_cur; //
double V_th;
double I_gen; // To monitor external generator current
double sum_buffer;
// Added for R2 update
double R2;
double old_Vm;
double new_Vm;
double old_slope; //
double new_slope;
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline long get_RefractoryCounts() const { return RefractoryCounts; }
inline void set_RefractoryCounts(const long RefractoryCounts) {
this->RefractoryCounts = RefractoryCounts;
}
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline long get_r() const { return r; }
inline void set_r(const long r) { this->r = r; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline long get_receptors() const{return receptors; }
inline void set_receptors(const long receptors) {
this->receptors = receptors;
}
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline std::vector<double> get_G0() const { return G0; }
inline void set_G0(const std::vector<double> G0) {
this->G0 = G0;
}
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline std::vector<double> get_bufferT() const { return bufferT; }
inline void set_bufferT(const std::vector<double> bufferT) {
this->bufferT = bufferT;
}
inline double get_Vth() const { return V_th; }
inline void set_Vth(const double V_th) { this->V_th = V_th; }
inline double get_I_gen() const { return I_gen; }
inline void set_I_gen(const double I_gen) { this->I_gen = I_gen; }
inline double get_sum_buffer() const { return sum_buffer; }
inline void set_sum_buffer(const double sum_buffer) { this->sum_buffer = sum_buffer; }
/* generated by template org.nest.nestml.function.StructGetterSetter*/
inline double get_tot_cur() const { return tot_cur; }
inline void set_tot_cur(const double tot_cur) { this->tot_cur = tot_cur; }
inline double get_R2() const { return R2; }
inline void set_R2(const double R2) { this->R2 = R2; }
inline double get_old_Vm() const { return old_Vm; }
inline void set_old_Vm(const double old_Vm) { this->old_Vm = old_Vm; }
inline double get_new_Vm() const { return new_Vm; }
inline void set_new_Vm(const double new_Vm) { this->new_Vm = new_Vm; }
inline double get_old_slope() const { return old_slope; }
inline void set_old_slope(const double old_slope) { this->old_slope = old_slope; }
inline double get_new_slope() const { return new_slope; }
inline void set_new_slope(const double new_slope) { this->new_slope = new_slope; }
};
/**
* Buffers of the neuron.
* Ususally buffers for incoming spikes and data logged for analog recorders.
* Buffers must be initialized by @c init_buffers_(), which is called before
* @c calibrate() on the first call to @c Simulate after the start of NEST,
* ResetKernel or ResetNetwork.
* @node Buffers_ needs neither constructor, copy constructor or assignment
* operator,
* since it is initialized by @c init_nodes_(). If Buffers_ has members
* that
* cannot destroy themselves, Buffers_ will need a destructor.
*/
struct Buffers_ {
Buffers_(eglif_cond_alpha_multisyn &);
Buffers_(const Buffers_ &, eglif_cond_alpha_multisyn &);
inline nest::RingBuffer &get_spikes_r1() { return spikes_r1; }
nest::RingBuffer spikes_r1;
//!< Buffer incoming Buffers through delay, as sum
;
double spikes_r1_last_value_;
inline nest::RingBuffer &get_spikes_r2() { return spikes_r2; }
nest::RingBuffer spikes_r2;
//!< Buffer incoming Buffers through delay, as sum
;
double spikes_r2_last_value_;
inline nest::RingBuffer &get_spikes_r3() { return spikes_r3; }
nest::RingBuffer spikes_r3;
//!< Buffer incoming Buffers through delay, as sum
;
double spikes_r3_last_value_;
inline nest::RingBuffer &get_spikes_r4() { return spikes_r4; }
nest::RingBuffer spikes_r4;
//!< Buffer incoming Buffers through delay, as sum
;
double spikes_r4_last_value_;
inline nest::RingBuffer &get_currents() { return currents; }
nest::RingBuffer currents;
//!< Buffer incoming Buffers through delay, as sum
;
double currents_last_value_;
/** Logger for all analog data */
nest::UniversalDataLogger<eglif_cond_alpha_multisyn> logger_;
std::vector<long> receptor_types_;
/* GSL ODE stuff */
gsl_odeiv_step *s_; //!< stepping function
gsl_odeiv_control *c_; //!< adaptive stepsize control function
gsl_odeiv_evolve *e_; //!< evolution function
gsl_odeiv_system sys_; //!< struct describing system
};
private:
/**
* @defgroup pif_members Member variables of neuron model.
* Each model neuron should have precisely the following four data members,
* which are one instance each of the parameters, state, buffers and variables
* structures. Experience indicates that the state and variables member should
* be next to each other to achieve good efficiency (caching).
* @note Devices require one additional data member, an instance of the @c
* Device
* child class they belong to.
* @{
*/
Parameters_ P_; //!< Free parameters.
State_ S_; //!< Dynamic state.