SaveState

classes
   fread          restore        writehoc       
   fwrite         save           
The 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 retored 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.

BUGS

The intention is that a save followed by any number of simulation-continue,restore pairs will give the same simulation result (assuming the simulation is deterministic). Given the possibility that simulations can be written to depend on a variety of computer states not saved in this object, this is more an experimental question than an assertion.

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 not work with the local variable timestep method.


save

SaveState

SYNTAX

.save()

DESCRIPTION

t, voltage, state and event values are stored in the object.


restore

SaveState

SYNTAX

.restore()

DESCRIPTION

t, voltage, state and event values are put back in the sections. Between a save and a restore, it is important not to create or delete sections, change the number of segments, insert or delete mechanisms, or change the location or number of point processes. Before restoring states, the object checks for consistency between its own data structure and the section structures.


fread

SaveState

SYNTAX

.fread(File)

DESCRIPTION

Reads binary state data from a File object into the SaveState object. (See File in ivochelp). This does not change the state of the sections. (That is done with .restore()). This function opens and closes the file defined by the File object.

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.


fwrite

SaveState

SYNTAX

.fwrite(File)

DESCRIPTION

Opens the file defined by the File object, writes saved binary state data to the beginning of the file and then closes the file.


writehoc

SaveState

SYNTAX

.writehoc(File)

DESCRIPTION

Writes saved state data as sequence of hoc statements that can be read with xopen(...). Not implemented at this time.


neuron/neuron/classes/savstate.hel : 3149 Mar 31