I am doing some batch processing, recording a vector during each run. During the run, I would like to periodically analyze the vector being recorded to determine if I can abort the particular run instead of having it run to completion before analyzing the vector. Is this possible? How?
Thanks,
Tom
Analyzing vector during record?
-
- Site Admin
- Posts: 6394
- Joined: Wed May 18, 2005 4:50 pm
- Location: Yale University School of Medicine
- Contact:
In pseudocode
Code: Select all
TTEST is the time at which you want to check the number of spikes.
For the sake of this example,
let's say you want the number of spikes that occur
within the first TTEST ms to lie in the range {MINSP, MAXSP]
TFULLRUN (which is > TTEST) is how long you'd let the simulation run
if it passes the test you apply at TTEST.
objref spiketimes, nc, null
spiketimes = new Vector()
// assuming that the cell's spike trigger zone is the (0.5) location
// of the default section
nc = new NetCon(&v(0.5), null)
nc.record(spiketimes) // records spike times to Vector spiketimes.
tstop = TTEST
func myrun() {
run()
if ((spiketimes.size()>=MINSP) && (spiketimes.size()<=MAXSP)) {
// I just lifted these from the ses file for a RunControl panel
// but you should also read about them in the chapter 7
// of The NEURON Book.
// Also see the Programmer's Reference documentation on stoprun.
continuerun(TFULLRUN)
stoprun = 1
return 1 // means "full run"
} else {
return 0 // means "short run"
}
}