""" This is just a 1ms Izhikevich model that spikes every 10ms. from istanbul. Now use that in the earlier (RetNetI.py) configuration, to get variable behaviour. Firing every 10ms with 4 on no surround 20ms with 3 on no surround none with 2 or 1 and 0-32 surround every 10ms 4 on 1 surround every 10ms 4 on 2 surround every 12ms 4 on 3 surround every 20ms 4 on 4 surround every 20ms 4 on 5 surround none 4 on 6 or more surround every 20ms 3 on 1 surround twice 3 on 2 surround none 3 on 3 or more surround """ from pyNN.utility import get_script_args, normalized_filename #from neo.io import NeoHdf5IO from neo.io import PyNNTextIO #from neo import io #DELAY = 10.0 DELAY = 1.0 SIM_LENGTH = 200.0 simulator_name = get_script_args(1)[0] exec("from pyNN.%s import *" % simulator_name) setup(timestep=DELAY,min_delay=DELAY,max_delay=DELAY,debug=True) #input neurons #default a .02, b .2, c -65, d 2.0, i_offset 0 cell_params = {'a' : 0.0, 'b' :0.2, 'c' : -65, 'd' : 0.0 } inpPop = Population(37,Izhikevich(**cell_params)) inpPop.initialize(v=-58.0) #output neuron outCell = create(Izhikevich, {'a' : 0.2 },2) #crh test #set up clamped input pulse = DCSource(amplitude=0.0038, start=0.0, stop=SIM_LENGTH) inputAssembly = Assembly(inpPop[15,16,21,22]) #inputAssembly = Assembly(inpPop[15,16,21]) #inputAssembly = Assembly(inpPop[1,15,16,21,22]) #inputAssembly = Assembly(inpPop[1,2,15,16,21,22]) #inputAssembly = Assembly(inpPop[1,2,3,15,16,21,22]) #inputAssembly = Assembly(inpPop[1,2,3,4,15,16,21,22]) #inputAssembly = Assembly(inpPop[1,2,3,4,5,15,16,21,22]) #inputAssembly = Assembly(inpPop[1,15,16,21]) #inputAssembly = Assembly(inpPop[1,2,15,16,21]) #----------no spikes #inputAssembly = Assembly(inpPop[1,2,3,4,5,6,15,16,21,22]) #inputAssembly = Assembly(inpPop[1,2,3,15,16,21]) #inputAssembly = Assembly(inpPop[15,16]) pulse.inject_into(inputAssembly) centreWeight = 7.0 surroundWeight = -2.0 #setup connections connE = connect(inpPop[15], outCell, weight=centreWeight, delay=DELAY) connE = connect(inpPop[16], outCell, weight=centreWeight, delay=DELAY) connE = connect(inpPop[21], outCell, weight=centreWeight, delay=DELAY) connE = connect(inpPop[22], outCell, weight=centreWeight, delay=DELAY) connI = connect(inpPop[1], outCell,weight=surroundWeight, delay=DELAY) connI = connect(inpPop[2], outCell,weight=surroundWeight, delay=DELAY) connI = connect(inpPop[3], outCell,weight=surroundWeight, delay=DELAY) connI = connect(inpPop[4], outCell,weight=surroundWeight, delay=DELAY) connI = connect(inpPop[5], outCell,weight=surroundWeight, delay=DELAY) connI = connect(inpPop[6], outCell,weight=surroundWeight, delay=DELAY) connI = connect(inpPop[7], outCell,weight=surroundWeight, delay=DELAY) #setup recording inpPop.record(['spikes','v']) outCell.record(['spikes','v']) #print inpPop[0].get_parameters() print outCell[0].get_parameters() run(SIM_LENGTH) #ifIn = inpPop.get_data() #print(ifIn) #print(ifIn.segments) #for seg in ifIn.segments: # print(seg.spiketrains) # print(seg.analogsignalarrays) outDat = outCell.get_data() for seg in outDat.segments: print(seg.spiketrains) # print(seg.analogsignalarrays) end()