bsb.simulation package#

Submodules#

bsb.simulation.simulation module#

class bsb.simulation.simulation.ProgressEvent(progression, duration, time)[source]#

Bases: object

class bsb.simulation.simulation.Simulation(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: object

add_progress_listener(listener)[source]#
abstract broadcast(data, root=0)[source]#

Broadcast data over MPI

cell_models#
connection_models#
devices#
duration#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

get_connectivity_sets() Mapping[ConnectionModel, ConnectivitySet][source]#
get_model_of(type: CellType | ConnectionStrategy) CellModel | ConnectionModel | None[source]#
get_node_name()#
abstract get_rank()[source]#

Return the rank of the current node.

abstract get_size()[source]#

Return the size of the collection of all distributed nodes.

name#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

post_prepare#
progress(step)[source]#

Report simulation progress.

simulator#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

start_progress(duration)[source]#

Start a progress meter.

step_progress(duration, step=1)[source]#

bsb.simulation.adapter module#

class bsb.simulation.adapter.SimulatorAdapter[source]#

Bases: object

abstract collect()[source]#

Collect the output of a simulation that completed

abstract prepare(simulation, comm=None)[source]#

Reset the simulation backend and prepare for the given simulations.

Parameters:
  • simulation (Simulation) – The simulation configuration to prepare.

  • comm – The MPI communicator to use. Only nodes in the communicator will participate in the simulation. The first node will idle as the main node. Calls set_communicator()

abstract run()[source]#

Fire up the prepared adapter.

abstract set_communicator(comm)[source]#

Set the communicator for this adapter.

simulate(simulation)[source]#

Simulate the given simulation.

bsb.simulation.cell module#

class bsb.simulation.cell.CellModel(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: SimulationComponent

Cell models are simulator specific representations of a cell type.

cell_type#

Whether this cell type is a relay type. Relay types, during simulation, instantly transmit incoming spikes to their targets.

get_node_name()#
parameters#

bsb.simulation.component module#

class bsb.simulation.component.SimulationComponent(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: SortableByAfter

create_after()[source]#
get_after()[source]#
get_node_name()#
classmethod get_ordered(objects)[source]#
has_after()[source]#
name#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

bsb.simulation.connection module#

class bsb.simulation.connection.ConnectionModel(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: SimulationComponent

connection_type#
get_node_name()#

bsb.simulation.device module#

class bsb.simulation.device.DeviceModel(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: SimulationComponent

get_node_name()#

bsb.simulation.results module#

class bsb.simulation.results.SimulationRecorder[source]#

Bases: object

flush()[source]#
class bsb.simulation.results.SimulationResult(simulation)[source]#

Bases: object

add(recorder)[source]#
create_recorder(flush)[source]#
flush()[source]#
write(filename, mode)[source]#

bsb.simulation.targetting module#

class bsb.simulation.targetting.ByIdTargetting(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: CellTargetting

Targetting mechanism (use "type": "by_id") to target all given identifiers.

get_node_name()#
get_targets(cells, connections)[source]#
ids#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.targetting.ByLabelTargetting(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: CellTargetting

Targetting mechanism (use "type": "by_label") to target all given labels.

get_node_name()#
get_targets(cells, connections)[source]#
labels#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.targetting.CellModelFilter[source]#

Bases: object

cell_models#
get_targets(cells, connections)[source]#
class bsb.simulation.targetting.CellModelTargetting(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: CellTargetting

Targetting mechanism (use "type": "cell_model") to target all cells of certain cell models.

cell_models#
get_node_name()#
get_targets(cells, connections)[source]#
class bsb.simulation.targetting.CellTargetting(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: Targetting

get_node_name()#
get_targets(cells, connections)[source]#
type#
class bsb.simulation.targetting.ConnectionTargetting(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: Targetting

get_node_name()#
get_targets(cells, connections)[source]#
type#
class bsb.simulation.targetting.CylindricalTargetting(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: CellModelFilter, CellTargetting

Targetting mechanism (use "type": "cylinder") to target all cells in a horizontal cylinder (xz circle expanded along y).

axis#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

get_node_name()#
get_targets(cells, connections)[source]#

Target all or certain cells within a cylinder of specified radius.

origin#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

radius#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.targetting.LocationTargetting(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: object

get_locations(cell)[source]#
get_node_name()#
strategy#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.targetting.RepresentativesTargetting(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: CellModelTargetting

Targetting mechanism (use "type": "representatives") to target all identifiers of certain cell types.

get_node_name()#
get_targets(cells, connections)[source]#
n#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.targetting.SomaTargetting(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: LocationTargetting

get_locations(cell)[source]#
get_node_name()#
class bsb.simulation.targetting.SphericalTargetting(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: CellModelFilter, CellTargetting

Targetting mechanism (use "type": "sphere") to target all cells in a sphere.

get_node_name()#
get_targets(cells, connections)[source]#

Target all or certain cells within a cylinder of specified radius.

origin#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

radius#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

class bsb.simulation.targetting.Targetting(*args, _parent=None, _key=None, **kwargs)[source]#

Bases: object

get_node_name()#
get_targets(cells, connections)[source]#
strategy#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

type#

Base implementation of all the different configuration attributes. Call the factory function attr() instead.

Module contents#

class bsb.simulation.SimulationBackendPlugin(Adapter: bsb.simulation.adapter.SimulatorAdapter, Simulation: bsb.simulation.simulation.Simulation)[source]#

Bases: object

Adapter: SimulatorAdapter#
Simulation: Simulation#
bsb.simulation.get_simulation_adapter(name)[source]#