hbp_nrp_cle.cle.DeterministicClosedLoopEngineProfiler module

Specification of the closed loop engine with profiling capabilities.

class DeterministicClosedLoopEngineProfiler(robot_control_adapter, robot_comm_adapter, brain_control_adapter, brain_comm_adapter, transfer_function_manager, external_simulation_manager, dt, profiler_mode=0, profiler_dir='')[source]

Bases: hbp_nrp_cle.cle.DeterministicClosedLoopEngine.DeterministicClosedLoopEngine

Implementation of the closed loop engine that runs with a profiler

load_brain(brain_file, brain_populations=None)[source]

Creates a new brain in the running simulation

Parameters
  • brain_file – A python PyNN script or an h5 file containing the neural network definition

  • brain_populations – A (optional) dictionary indexed by population names and containing neuron indices. Neuron indices can be defined by lists of integers or slices. Slices are either python slices or dictionaries containing ‘from’, ‘to’ and ‘step’ values.

loop()[source]

Starts the orchestrated simulations with the profiler activated. This function does not return (starts an infinite loop).

run_step(timestep_s)[source]

Runs both simulations for the given time step in seconds recording profiling data

Parameters

timestep_s – simulation time, in seconds

Returns

Updated simulation time, otherwise -1

shutdown()[source]

Shuts down both simulations.

log_brain_sim_info_nest(timestep, brain_load_time=0.0, csv_recorder=None, csv_filename='')[source]

Logs information from nest simulation into a CSVRecorder object

Parameters
  • timestep – simulation timestep

  • brain_load_time – time taken to load the brain file in seconds

  • csv_recorder – instance of CSVRecorder to be used for logging. If None, a new one is created

  • csv_filename – name for the csv file where information will be logged. Just used if csv_recorder is None.

Returns

csv_recorder