SimulationResult#

class brainpy.state.network.SimulationResult(recordings, duration, dt, *, traces=None, times=None, weights=None)#

Recorded spikes and analog traces from a Simulator.simulate() run.

Spike recorders are read with spikes() / n_events() / rate(). Analog recorders (voltmeter / multimeter, connected in NEST’s reversed direction) are read with trace(), and the common time axis with times.

rate(node)[source]#

Mean firing rate in spikes/second over all recorded neurons.

spikes(node)[source]#

Per-step spike matrix (n_steps, n_recorded) for a recorder/source.

property times#

The common time axis (n_steps,) of the run (brainunit Quantity).

trace(recorder, recordable='V_m')[source]#

Analog trace (n_steps, n_recorded) for an analog recorder.

Parameters:
  • recorder (NodeView) – The voltmeter / multimeter handle returned by Simulator.create() and connected via connect(recorder, pop).

  • recordable (str, optional) – Recordable name (NEST vocabulary, e.g. 'V_m', 'g_ex'). Default is 'V_m'.

Returns:

(n_steps, n_recorded) trace in the model state’s natural unit.

Return type:

brainunit.Quantity

Raises:

KeyError – If recordable was not recorded by this recorder.

weight_trace(proj)[source]#

Per-step weight trajectory (n_steps, n_edges) for a recorded proj.

Parameters:

proj (EventPlasticProj) – The plastic-projection handle returned by connect(..., synapse=spec) and registered via Simulator.record_weight() before the run.

Returns:

(n_steps, n_edges) weights in the synapse weight unit (pA), in CSR (sorted-by-pre) edge order — the same order the rule kernel sees.

Return type:

brainunit.Quantity

Raises:

KeyError – If this projection’s weight was not recorded (no Simulator.record_weight() before Simulator.simulate()).