classes fread restore writehoc fwrite saveThe state includes t, the voltage for all segments of all sections, and all the STATEs defined in all the membrane and point process mechanisms. With regard to model descriptions, it does not include PARAMETERs, ASSIGNED variables. It always includes values for the ambiguous variable of ions such as cai, ko, or ena. This can be an expensive object in terms of memory storage.
The state also includes all the outstanding events (external and self) and the weight vectors of all NetCon objects. For model descriptions containing a NET_RECEIVE block, all the ASSIGNED variables are also included in the state (this is because such models often use such variables to store logic state and other values, such as the last event time t0, needed to compute state variables at the next event.)
The outstanding event delivery times are absolute. When restored, all outstanding events will be cleared and the restored event times and NetCon info will take their place. Note that it is not in general possible to change the value of t in a network simulation since most NET_RECEIVE blocks keep t0 (the last event time) as part of their state.
Between a save and a restore, it is important not to create or delete sections, NetCon objects, or point processes. Do not change the number of segments, insert or delete mechanisms, or change the location of point processes.
Does work with the local variable timestep method if the stdrun system is used since continuerun() uses cvode.solve(tstop) to integrate and this returns with all states at tstop. However, if you advance using fadvance() calls different cells will be at different t values in general and SaveState will be useless.
If the arg is 1, then the event queue is not cleared and no saved events are put back on the queue. Therefore any Vector.play and/or FInitializeHandler events on the queue after finitialize() are not disturbed.
.restore()). This function opens the file defined by the File object. On return the file is closed unless the second arg exists and is 1.
Warning: file format depends on what mechanisms are available in the executable and the order that sections are created (and mechanisms inserted) by the user. Also the order of NetCon, ArtificialCell, PointProcess creation and just about everything else that gets saved in the file. I.e. if you change your simulation setup, old files may become incompatible.
In a parallel simulation, each host id , should write an id specific file. Note that the set of files is at least nhost specific.
xopen(...). Not implemented at this time.