what does run() do?

The basics of how to develop, test, and use models.
Post Reply
JZ
Posts: 6
Joined: Tue Jun 12, 2007 4:21 pm

what does run() do?

Post by JZ »

What exactly happens when you call "run()"?
Does it automatically call "finitialize()?" Because it seems to be behaving like it is doing that...

my code looks like this:

Code: Select all

fin = FInitializeHandler ("func()")

proc func () {
    print "test"
    }

finitialize()
run()
I get an output that looks like:

test
test

rather than the single "test" that I would have expected...
ted
Site Admin
Posts: 6384
Joined: Wed May 18, 2005 4:50 pm
Location: Yale University School of Medicine
Contact:

Post by ted »

Good diagnosis. run() is discussed on pages 163-164 of The NEURON Book.
Alternatively, you can analyze stdrun.hoc in nrn/share/nrn/lib/hoc/ (c:\nrnxx\lib\hoc
under MSWin).

In NEURON 6.0, the standard run system's definition of run() is

Code: Select all

proc run() {
        running_ = 1
        stdinit()
        continuerun(tstop)
}
stdinit() is defined as

Code: Select all

proc stdinit() {
        cvode_simgraph()
        realtime = 0
        setdt()
        init()
        initPlot()
}
and the definition of init(), complete with comments, is

Code: Select all

proc init() {
        finitialize(v_init)
        // fcurrent() // no longer necessary. finitialize now
        // initializes all conductances and currents as well as states.
        // Extra initialization should normally go here.
        // If you change any states or parameters after an finitialize
        // then you should complete the initialization with
    /*
        if (cvode.active()) {
                cvode.re_init()
        }else{
                fcurrent()
        }
        frecord_init()
    */
}
Post Reply