hbp_nrp_cle.brainsim.BrainInterface module

This module represents the interfaces for the brain communication and control adapter

class IACSource[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainDevice

Represents a current generator which generates alternating current

property amplitude

Gets or sets the amplitude of this current generator

class IBrainCommunicationAdapter[source]

Bases: object

Represents the communication interface to the neuronal simulator

activate_device(device, activate)[source]

Change the activation status of the device.

Parameters
  • device – the device on which to apply the change

  • activate – a boolean value denoting the new activation state

Raises

AttributeError – the device doesn’t support activation

create_view(population, sl)[source]

Creates a view of the given population

Parameters
  • population – The base population

  • sl – The slice of the population that represents the view

initialize()[source]

Initializes the adapter

is_population(population)[source]

Determines whether the given object is a population

Parameters

population – The object that may be a population

refresh_buffers(t)[source]

Refreshes all detector buffers

Parameters

t – The simulation time

register_spike_sink(populations, spike_detector_type, **kwargs)[source]

Requests a communication object with the given spike detector type for the given set of neurons

Parameters
  • populations – A reference to the populations which should be connected to the spike detector

  • spike_detector_type – A spike detector type (see Brain adapters)

  • kwargs – A dictionary of configuration parameters

Returns

A Communication object

register_spike_source(populations, spike_generator_type, **kwargs)[source]

Requests a communication object with the given spike generator type for the given set of neurons

Parameters
  • populations – A reference to the populations to which the spike generator should be connected

  • spike_generator_type – A spike generator type (Brain adapters)

  • kwargs – A dictionary of configuration parameters

Returns

A communication object

shutdown()[source]

Shuts down the brain communication adapter

unregister_spike_sink(device)[source]

Disconnects and unregisters the given spike detector device.

Parameters

device – The spike detector device to deregister.

unregister_spike_source(device)[source]

Disconnects and unregisters the given spike generator device.

Parameters

device – The spike generator device to deregister.

class IBrainControlAdapter[source]

Bases: object

Represents a controller object for the neuronal simulator

get_populations()[source]

Gets an information about the populations currently available

Returns

A list of population infos

initialize(**params)[source]

Initializes the neuronal simulator

is_alive()[source]

Gets a status whether the neuronal simulator is still alive

Returns

True if the simulator is alive, otherwise False

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 – Additional populations to create (Optional)

load_populations(populations)[source]

Load (or reload) populations defined on the currently loaded brain. CAUTION: Populations become invalid when the brain they are defined on is changed.

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.

Raises

Exception – When no brain is currently loaded

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

shutdown()[source]

Shuts down the neuronal simulator

class IBrainDevice[source]

Bases: object

Device to connect to brain simulation

property active

Returns the activation state of this device

connect(neurons)[source]

Connects the brain device to the specified neuron population.

Parameters

neurons – the neurons of the brain to which the device will connect

reset(transfer_function_manager)[source]

Resets the device

Parameters

transfer_function_manager – The transfer function manager the device belongs to

Returns

The reset adapter

class ICustomDevice[source]

Bases: object

Represents device type with an internal logic that can be mapped to existing device types A brain communication adapter may chose whether to use the custom device or to support it directly

apply(neurons, brain_adapter, **config)[source]

Apply the device type to the neurons with the given set of GIDs and the given adapter

Parameters
  • config – Additional device configuration

  • neurons – A list of neuron GIDs for which to create the custom device

  • brain_adapter – The brain communication adapter

reset(transfer_function_manager)[source]

Resets the device

Parameters

transfer_function_manager – The transfer function manager the device belongs to

Returns

The reset adapter

class IDCSource[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainDevice

Represents a current generator which generates direct current

property amplitude

Gets or sets the amplitude of this current generator

class IDeviceGroup[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainDevice

Gathers multiple devices to a group

connect(neurons, **params)[source]

Connects the devices contained in this device group to the specified neuron population. If the neuron population has the same size as the amount of devices contained in the device group a One-to-One connection is used.

Parameters
  • neurons – the neurons of the brain to which the device will connect

  • params – additional, device specific parameters. For each parameter either the value can be supplied, or a list of values, one for each nested device.

class IFixedSpikeGenerator[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainDevice

Represents a communication object that generates spikes on a fixed rate

property rate

Gets or sets the rate in which spikes should be generated

class ILeakyIntegratorAlpha[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainDevice

Represents the membrane voltage of a current-based LIF neuron with alpha-shaped post-synaptic currents. The neurons default threshold potential is set to infinity, so that the neuron never spikes, but only serves as a leaky integrator of the incoming spike train.

property voltage

Gets the current voltage of the voltmeter

class ILeakyIntegratorExp[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainDevice

Represents the membrane voltage of a current-based LIF neuron with decaying-exponential post-synaptic currents. The neurons default threshold potential is set to infinity, so that the neuron never spikes, but only serves as a leaky integrator of the incoming spike train.

property voltage

Gets the current voltage of the voltmeter

class INCSource[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainDevice

Represents a current generator which generates noisy current

property mean

Gets or sets the mean value for the noisy current

class IPoissonSpikeGenerator[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainDevice

Represents a spike generator based on a Poisson Distribution

property rate

Gets or sets the rate in which spikes should be generated

class IPopulationRate[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainDevice

Represents a device which returns the spiking frequency of a population of neurons

property rate

Gets the current rate of the neuron population

class IRawSignal[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainDevice

Represents a device that allows for the exchange of raw data values. There is no direct neural equivalent as the semantics of the device depend on the semantics of the neural simulator.

property value

Gets the current value.

class ISpikeInjector[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainDevice

Represents a spike injector that is able to inject single spikes

inject_spikes()[source]

Injects a spike to the connected population

class ISpikeRecorder[source]

Bases: hbp_nrp_cle.brainsim.BrainInterface.IBrainDevice

Represents a device that captures whether a neuron has spiked since the last iteration

property neuron_id_range

Returns a tuple with the first and last neurons’ id of the devices

property spiked

Gets a value indicating whether the neuron has spiked since the last iteration

property times

Returns the times and neuron IDs of the recorded spikes within the last time step.

class PopulationInfo[source]

Bases: object

Gathers information about neuron populations

property celltype

Gets the celltype of the population

property gids

Gets the global unique identifiers for this population

property indices

Gets the population indices

property name

Gets the population name

property parameters

Gets the parameters of a the population as dict