Good question.
Your code executes nc.event when the file is first parsed. However, when you initialize, the
event is discarded. To quote from
8.2 Basic initialization in NEURON: finitialize()
on page 185 of The NEURON Book:
Basic initialization in NEURON . . . carries out several actions:
1. t is set to 0 and the event queue is cleared (undelivered events from the previous run are
thrown away).
So what is needed is a means to load the event queue during the process of initialization
in such a way that the loaded event(s) will not be discarded.
This would do the job: comment out
nc.event(2.5)
and insert this bit of code in its place:
Code: Select all
objref fih
fih = new FInitializeHandler("nc.event(2.5)")
The most general way to do this is to write a proc that contains all special initializations
that are required, e.g. any NetCon event() calls, and use an FInitializeHandler to ensure
that your special proc will be called as part of initialization.
For another example of the use of the FInitializeHandler class, see
https://www.neuron.yale.edu/phpBB2/viewtopic.php?t=162
For more info about the FInitializeHandler class, see
http://www.neuron.yale.edu/neuron/stati ... ithnd.html