Output of a probe to adjust live current

Hey there,
I am considered new in Nengo and Nengoforum :wave:. I am trying to create a network model and I need to collect live current from an ensemble to arrange a transform value to the other ens. For example I have 3 separate ens. I need to adjust one of the ens(C) output from another (A) ens output like “when the output of A smaller than 0.5 , stop the signal from C”. I already tried probes with simulation step_runs to collect data from A to compare actual simulation currents but I don’t know what kind of data we collect from probes. And as far as I understand, run_step or step function will carry my network to further steps but all I want is that if my simulation is running, what is my current for 3s. It will be easier to show with codes so basically:
Thanks !

with nengo.Network() as model:
    input1 = nengo.Node(np.sin, size_out = 1) 
    A = nengo.Ensemble(n_neurons = 100, dimensions = 1)
    B = nengo.Ensemble(n_neurons = 100, dimensions = 1)
    C = nengo.Ensemble(n_neurons = 100, dimensions = 1)
    output1 = nengo.Node(size_in = 1)

    nengo.Connection(input1,A)
    nengo.Connection(A,B)
with nengo.Simulator(model) as sim:
        sim.run_steps(3)
    if (output_current of A < 0.5):
          nengo.Connection(B,C, transform == [[0]])
    else:
          nengo.Connection(B,C, transform == [[1]])
    nengo.Connection(C,output1)

Welcome to the forum!

What you want to compute is a two-dimensional function that allows the first dimension to pass through if the second dimension is greater than 0.5, but not otherwise. Something like this:

def gating_function(x):
    return x[1] * (1 if x[0] > 0.5 else 0)

To compute this, we need an ensemble that is simultaneously representing both these values. This is because it is a nonlinear computation, so we need neurons that are tuned to both dimensions to compute this nonlinear function. You don’t get this with two separate ensembles. See the 2D representation and multiplication tutorials.

One way to do this is create a 2D ensemble D, and connect A and B into it.

with model:
    D = nengo.Ensemble(n_neurons = 200, dimensions = 2)
    nengo.Connection(A,D[0])
    nengo.Connection(B,D[1])
    nengo.Connection(D, C, function=gating_function)