# restore function¶

(Shortest import: from brian2 import restore)

brian2.core.magic.restore(name='default', filename=None, restore_random_state=False)[source]

Restore the state of the network and all included objects.

Parameters

name : str, optional

The name of the snapshot to restore, if not specified uses 'default'.

filename : str, optional

The name of the file from where the state should be restored. If not specified, it is expected that the state exist in memory (i.e. Network.store was previously called without the filename argument).

restore_random_state : bool, optional

Whether to restore the state of the random number generator. If set to True, going back to an earlier state of the simulation will continue exactly where it left off, even if the simulation is stochastic. If set to False (the default), random numbers are independent between runs (except for explicitly set random seeds), regardless of whether store()/restore() has been used or not. Note that this also restores numpy’s random number generator (since it is used internally by Brian), but it does not restore Python’s builtin random number generator in the random module.