target_positions

Contents

target_positions#

class brainpy.state.spatial.target_positions(sim, source, target)[source]#

Coordinates of each source node’s realized targets (NEST GetTargetPositions).

Parameters:
  • sim (Simulator) – The simulator holding the realized connections and target positions.

  • source (NodeView) – A single-segment source view (one entry is returned per node).

  • target (NodeView) – The candidate-target population view (created with positions=).

Returns:

One (k_i, ndim) coordinate array per source node, in source order.

Return type:

list of Quantity

See also

target_nodes

the underlying realized-target index query.

Examples

>>> from brainpy import state as bp
>>> import brainunit as u
>>> sim = bp.Simulator(dt=0.1 * u.ms)
>>> pop = sim.create(bp.iaf_psc_alpha, positions=bp.spatial.grid([3, 1], extent=[3.0, 1.0]))
>>> _ = sim.connect(pop, pop,
...     rule=bp.spatial.spatial_pairwise_bernoulli(p=1.0, mask=bp.spatial.circular(1.2)),
...     weight=1.0 * u.pA, delay=1.0 * u.ms)
>>> [tuple(p.shape) for p in bp.spatial.target_positions(sim, pop, pop)]
[(2, 2), (3, 2), (2, 2)]