Ejemplo n.º 1
0
    def runs(self):
        self.setup()
        steps, time = self.steps, self.time

        with nest.RunManager():
            return [(s, t) for _ in range(steps)
                    for s, t in self.runner(time, nest.Run)]
Ejemplo n.º 2
0
 def runs(self):
     with nest.RunManager():
         for _ in range(self.steps):
             nest.Run(self.time)
nest.Connect(qsyn_voltmeter, qsyn_neuron)

###############################################################################
# This loop runs over the `n_trials` trials and performs a standard protocol
# of a high-rate response, followed by a pause and then a recovery response.
#
# We actually run over ``n_trials + 1`` rounds, since the first trial is for
# equilibration and is not recorded (see voltmeter parameters above).
#
# We use the NEST ``:class:.RunManager`` to improve performance and call ``:func:.Run``
# inside for each part of the simulation.
#
# We print a line of breadcrumbs to indicate progress.

print(f"Simulating {n_trials} times ", end="", flush=True)
with nest.RunManager():
    for t in range(n_trials + 1):
        pre_neuron.I_e = I_stim
        nest.Run(T_on)

        pre_neuron.I_e = 0.0
        nest.Run(T_off)

        if t % 10 == 0:
            print(".", end="", flush=True)
print()

###############################################################################
# Simulate one additional time step. This ensures that the
# voltage traces for all trials, including the last, have the full length, so we
# can easily transform them into a matrix below.