Skip to content

Commit

Permalink
neuron: don't update cyc plot during spikevsrate -- deadly
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed Aug 20, 2024
1 parent c03ae3a commit fa7d9c5
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions ch2/neuron/neuron.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func (ss *Sim) UpdateView() {
// Running the Network, starting bottom-up..

// RunCycles updates neuron over specified number of cycles
func (ss *Sim) RunCycles() {
func (ss *Sim) RunCycles(updt bool) {
ctx := &ss.Context
ss.Init()
ss.GUI.StopNow = false
Expand Down Expand Up @@ -238,15 +238,17 @@ func (ss *Sim) RunCycles() {
ctx.Cycle = cyc
ss.Logs.Log(etime.Test, etime.Cycle)
ss.RecordValues(cyc)
if cyc%ss.UpdateInterval == 0 {
if updt && cyc%ss.UpdateInterval == 0 {
ss.UpdateView()
}
ss.Context.CycleInc()
if ss.GUI.StopNow {
break
}
}
ss.UpdateView()
if updt {
ss.UpdateView()
}
}

// RateUpdate updates the neuron in rate-code mode
Expand Down Expand Up @@ -299,7 +301,7 @@ func (ss *Sim) SpikeVsRate() {
ss.Spike = true
for ns := 0; ns < nsamp; ns++ {
tcl.Rows = 0
ss.RunCycles()
ss.RunCycles(false)
if ss.GUI.StopNow {
break
}
Expand All @@ -311,7 +313,7 @@ func (ss *Sim) SpikeVsRate() {
// ss.Noise = 0 // doesn't make much diff
for ns := 0; ns < nsamp; ns++ {
tcl.Rows = 0
ss.RunCycles()
ss.RunCycles(false)
if ss.GUI.StopNow {
break
}
Expand Down Expand Up @@ -462,7 +464,7 @@ func (ss *Sim) ConfigGUI() {
if !ss.GUI.IsRunning {
go func() {
ss.GUI.IsRunning = true
ss.RunCycles()
ss.RunCycles(true)
ss.GUI.IsRunning = false
ss.GUI.UpdateWindow()
}()
Expand Down

0 comments on commit fa7d9c5

Please sign in to comment.