hbp_nrp_cle.brainsim.pynn.PyNNControlAdapter module¶
PyNNControlAdapter.py moduleauthor: probst@fzi.de
-
class
PyNNControlAdapter
(sim)[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
(**params)[source]¶ Initializes the neuronal simulator
- Parameters
timestep – The timestep used for the neuronal simulation
min_delay – The minimum delay
max_delay – The maximum delay
threads – The amount of threads that should be used to run the simulation
rng_seeds – The rng seeds for the simulation
- Returns
True if the simulator is initialized, otherwise False
-
is_alive
()[source]¶ Gets a status whether the neuronal simulator is still alive
- Returns
True if the simulator is alive, otherwise False
-
property
is_initialized
¶ Gets a value indicating whether initialize has been called
-
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.
- 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
-
static
populations_using_json_slice
(populations)[source]¶ Turn populations defined as python slices into python dicts to allow straightforward translation in to json.
- Parameters
populations – a dictionary whose values are either python lists or slices. Slices can be of two types, either python slices, or dictionnaries of the form {‘from’: 1, ‘to’: 10, ‘step’: 2}
- Returns
A dictionary where python slices have been replaced by dictionaries referred to as ‘json slices’.
-
static
populations_using_python_slice
(populations)[source]¶ Turn slices defined as python dicts into python slices. Populations of type list are left unchanged.
- Parameters
populations – a dictionary whose values are either python lists or slices. Slices can be of two types, either python slices, or dictionaries of the form {‘from’: 1, ‘to’: 10, ‘step’: 2}
- Returns
A dictionary where ‘json slices’ (plain python dicts) have been replaced by python slices.
-