Skip to content

Commit

Permalink
Use scalar variables for the stimulus (example is still work-in-progr…
Browse files Browse the repository at this point in the history
…ess).
  • Loading branch information
Marcel Stimberg committed Feb 27, 2014
1 parent 0064636 commit 95f5c53
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions examples/synapses_barrelcortex.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@
isactive = abs((barrel_x - bar_x + 0.5) * cos(direction) + (barrel_y - bar_y + 0.5) * sin(direction)) < 0.5: bool
bar_x = cos(direction)*(t - stim_start_time)/(5*ms) + stim_start_x : 1
bar_y = sin(direction)*(t - stim_start_time)/(5*ms) + stim_start_y : 1
direction : 1 # direction of the current stimulus
stim_start_time : second # start time of the current stimulus
stim_start_x : 1 # start position of the stimulus
stim_start_y : 1 # start position of the stimulus
barrel_x : 1 # The x position of the barrel
barrel_y : 1 # The y position of the barrel
selectivity : 1''',
barrel_x : 1 # The x position of the barrel
barrel_y : 1 # The y position of the barrel
selectivity : 1
# Stimulus parameters (same for all neurons)
direction : 1 (scalar) # direction of the current stimulus
stim_start_time : second (scalar) # start time of the current stimulus
stim_start_x : 1 (scalar) # start position of the stimulus
stim_start_y : 1 (scalar) # start position of the stimulus
''',
threshold='rand() < rate*dt',
dtype={'barrel_x': np.int32,
'barrel_y': np.int32},
Expand Down Expand Up @@ -153,13 +155,6 @@
print 'recurrent exc:', len(recurrent_exc)
print 'recurrent inh:', len(recurrent_inh)

# Stimulation
stimspeed = 1./stim_change_time # speed at which the bar of stimulation moves
direction = 0.0
stimzonecentre = ones(2)*barrelarraysize/2.
stimcentre,stimnorm = zeros(2),zeros(2)
stimradius = (11*stim_change_time*stimspeed+1)*.5
stimradius2 = stimradius**2

t2=time.time()
print "Construction time:",t2-t1,"s"
Expand Down

0 comments on commit 95f5c53

Please sign in to comment.