Presumably each of your c*.hoc files contains a specification of the properties of a different model cell. To avoid problems such as conflicts in variable name space, orphaned point processes, and incorrect initialization of user-specified hoc variables, each model cell must be exercised in its own NEURON session. In other words, you have to
start NEURON and make it load cell1.hoc
run a simulation
save results
exit NEURON
start NEURON and make it load cell2.hoc
run a simulation
save results
exit NEURON
. . .
The easiest way to do this is by writing a shell script ("batch file") using whatever command line utilities your operating system provides. Or you could use a scripting language such as perl, python, or ruby.
You need to create a loop that calls NEURON as many times as necessary, each time with a different argument that makes NEURON load a different c*.hoc file. Execute
nrngui -h
and you'll discover that one of its command line switches is -c, which allows you to pass nrngui a hoc statement.
Here's a hoc program that uses this feature to create a file name that includes an integer that is passed on the command line:
Code: Select all
/*
test.hoc
demonstration how to use the command line to pass NEURON a parameter
Command line makes NEURON print
nrngui test.hoc filename is c0.hoc
nrngui -c "zzz=1" filename is c1.hoc
nrngui -c "zzz=PI" filename is c3.hoc
nrngui -c "zzz=-PI" filename is c9999.hoc
*/
load_file("nrngui.hoc")
strdef filename
num = 0
if (name_declared("zzz")==5) { // zzz has been assigned a numerical value
if (zzz>=0) {
num = int(zzz)
} else {
num = 9999
}
}
sprint(filename,"c%d.hoc",num)
print "filename is ", filename
Be sure to read about sprint and name_declared in the Programmer's Reference.
The rest is up to you.