brian2modelfitting.simulator module

class brian2modelfitting.simulator.CPPStandaloneSimulator[source]

Bases: brian2modelfitting.simulator.Simulator

Simulation class created for use with CPPStandaloneDevice

initialize(network, var_init, name='fit')

Prepares the simulation for running

Parameters:
  • network (Network) – Network consisting of a NeuronGroup named neurons and either a monitor named spikemonitor or a monitor named ``statemonitor``(or both).
  • var_init (dict) – dictionary to initialize the variable states
  • name (str, optional) – name of the network
neurons
run(duration, params, params_names, iteration, name='fit')[source]

Simulation has to be run in two stages in order to initialize the code generation

spikemonitor
statemonitor
class brian2modelfitting.simulator.RuntimeSimulator[source]

Bases: brian2modelfitting.simulator.Simulator

Simulation class created for use with RuntimeDevice

initialize(network, var_init, name='fit')[source]

Prepares the simulation for running

Parameters:
  • network (Network) – Network consisting of a NeuronGroup named neurons and either a monitor named spikemonitor or a monitor named ``statemonitor``(or both).
  • var_init (dict) – dictionary to initialize the variable states
  • name (str, optional) – name of the network
neurons
run(duration, params, params_names, iteration, name='fit')[source]

Restores the network, sets neurons to required parameters and runs the simulation

Parameters:
  • duration (Quantity) – Simulation duration
  • params (dict) – parameters to be set
  • params_names (list[str]) – names of parameters to set the dictionary
spikemonitor
statemonitor
class brian2modelfitting.simulator.Simulator[source]

Bases: object

Simulation class created to perform a simulation for fitting traces or spikes.

initialize(network, var_init, name='fit')[source]

Prepares the simulation for running

Parameters:
  • network (Network) – Network consisting of a NeuronGroup named neurons and either a monitor named spikemonitor or a monitor named ``statemonitor``(or both).
  • var_init (dict) – dictionary to initialize the variable states
  • name (str, optional) – name of the network
neurons
run(duration, params, params_names, iteration, name)[source]

Restores the network, sets neurons to required parameters and runs the simulation

Parameters:
  • duration (Quantity) – Simulation duration
  • params (dict) – parameters to be set
  • params_names (list[str]) – names of parameters to set the dictionary
spikemonitor
statemonitor
brian2modelfitting.simulator.initialize_neurons(params_names, neurons, params)[source]

initialize each parameter for NeuronGroup returns dictionary of Dummy devices

brian2modelfitting.simulator.initialize_parameter(variableview, value)[source]

initialize parameter variable in static file, returns Dummy device

brian2modelfitting.simulator.run_again()[source]

re-run the NeuronGroup on cpp file

brian2modelfitting.simulator.set_parameter_value(identifier, value)[source]

change parameter value in cpp file

brian2modelfitting.simulator.set_states(init_dict, values)[source]

set parameters values in the file for the NeuronGroup