| 1 | import pyNN.nest as pynn |
|---|
| 2 | |
|---|
| 3 | import numpy |
|---|
| 4 | import pylab |
|---|
| 5 | |
|---|
| 6 | pynn.setup(timestep=0.1) |
|---|
| 7 | |
|---|
| 8 | numCellsExc = 2 |
|---|
| 9 | numCellsInh = 2 |
|---|
| 10 | |
|---|
| 11 | w_exc = 0.0002 # uS |
|---|
| 12 | w_inh = 0.0008 # uS |
|---|
| 13 | |
|---|
| 14 | expDuration = 1000 # msec |
|---|
| 15 | |
|---|
| 16 | if_cond_exp_params = { |
|---|
| 17 | 'tau_m' : 20.0, |
|---|
| 18 | 'i_offset' : 0.1, |
|---|
| 19 | 'tau_refrac' : 3.0, |
|---|
| 20 | 'v_thresh' :-63.0, |
|---|
| 21 | 'tau_syn_E' : 30.0, |
|---|
| 22 | 'tau_syn_I' : 30.0, |
|---|
| 23 | 'v_reset' :-69.0, |
|---|
| 24 | 'e_rev_E' : 0., |
|---|
| 25 | 'e_rev_I' :-70., |
|---|
| 26 | 'v_init' :-70.0 |
|---|
| 27 | } |
|---|
| 28 | |
|---|
| 29 | cells_exc = pynn.create(pynn.IF_cond_exp, if_cond_exp_params, n=numCellsExc) |
|---|
| 30 | cells_inh = pynn.create(pynn.IF_cond_exp, if_cond_exp_params, n=numCellsInh) |
|---|
| 31 | |
|---|
| 32 | pynn.connect(source=cells_inh, target=cells_exc, weight=w_inh, synapse_type='inhibitory') |
|---|
| 33 | pynn.connect(source=cells_inh, target=cells_inh, weight=w_inh, synapse_type='inhibitory') |
|---|
| 34 | |
|---|
| 35 | pynn.record(cells_exc, 'spikes_nest.dat') |
|---|
| 36 | |
|---|
| 37 | pynn.run(expDuration) |
|---|
| 38 | pynn.end() |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | |
|---|