hbp_nrp_cle.brainsim.nengo.NengoControlAdapter module

NengoControlAdapter.py moduleauthor: krach@fzi.de

class NengoControlAdapter(nengo_simulation_state, loihi=False)[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainControlAdapter

Represents a controller object for the neuronal simulator

get_Timeout()[source]

returns The maximum amount of time (in seconds) to wait for the end of this step

get_populations()[source]

Gets an information about the populations currently available

Returns

A list of population infos

initialize(**sim_params)[source]

Initializes the neuronal simulator. All additional keyword parameters are passed to the constructor of the simulator.

Returns

True if the simulator is initialized, otherwise False

is_alive()[source]

Gets a status whether the neuronal simulator is still alive When the simulator is loihi we have to avoid checking the closed attribute because Nengo loihi has a check that throws when we instantiate a simulator without a network attached to it. This is the case when we check the is_alive function. Better to avoid this check for loihi until a better solution is found.

Returns

True if the simulator is alive, otherwise False

property is_initialized

Gets a value indicating whether initialize has been called

is_loihi()[source]

Determines whether loihi is used as a backend

load_brain(brain_file, populations=None)[source]

Loads the neuronal network contained in the given file

Parameters
  • brain_file – The path to the neuronal network file

  • populations – UNUSED

load_populations(populations)[source]

Load (or reload) populations into the brain

Parameters

populations – A dictionary indexed by population names and containing neuron indices. Neuron indices can be defined by a single integer, list of integers or python slices. Python slices can be replaced by a dictionary containing the ‘from’, ‘to’ and ‘step’ values.

reset()[source]

Resets the neuronal simulator

run_step(dt)[source]

Runs the neuronal simulator for the given amount of simulated time

Parameters

dt – the simulated time in milliseconds

shutdown()[source]

Shuts down the neuronal simulator