how to use SaveState()?
Posted: Fri Sep 23, 2005 7:29 am
Hi,
the network I am simulating has a very long transient before it settles into the dynamic regime I am interested in.
My idea is now to use SaveState() to save the network state after the transient and then run a sweep of simulations starting of at that point.
My questions are:
How can you set the time point the network state is saved?
Can you use continuetil() to run simulations from the restore point on?
Well, any example of how to use SaveState would be very helpful!
Many thanks in advance!
Ulli
update:
tried to save state, load similar hoc file and read state file, error was:
/usr/local/nrn/x86_64/bin/nrniv: Bad SaveState binary file Not version 5.6 in transrun2.hoc near line 58
IBnetstate.fread(fo)
^
SaveState[0].fread(File[1])
code used to save state:
the network I am simulating has a very long transient before it settles into the dynamic regime I am interested in.
My idea is now to use SaveState() to save the network state after the transient and then run a sweep of simulations starting of at that point.
My questions are:
How can you set the time point the network state is saved?
Can you use continuetil() to run simulations from the restore point on?
Well, any example of how to use SaveState would be very helpful!
Many thanks in advance!
Ulli
update:
tried to save state, load similar hoc file and read state file, error was:
/usr/local/nrn/x86_64/bin/nrniv: Bad SaveState binary file Not version 5.6 in transrun2.hoc near line 58
IBnetstate.fread(fo)
^
SaveState[0].fread(File[1])
code used to save state:
Code: Select all
objref IBnetstate[Ncol]
k=0
strdef fn, fn0
sprint(fn0,"%s%s",outstr,"Netstate_%d.dat")
for i=0,Ncol-1 {
sprint(fn,fn0,i)
print fn
fp.wopen(fn)
if ( t>=500 && k<1){
IBnet[i].soma IBnetstate[i] = new SaveState()
IBnetstate[i].save()
IBnetstate[i].fwrite(fp)
k=k+1
fp.close()
}
}