예제 #1
0
 def __init__(self,
              n,
              equations,
              threshold,
              reset=brian.NoReset(),
              refractory=0 * ms,
              implicit=False,
              compile=True,
              **parameters):
     if "tau_refrac" in parameters:
         max_refractory = parameters["tau_refrac"].max() * ms
     else:
         max_refractory = None
     brian.NeuronGroup.__init__(self,
                                n,
                                model=equations,
                                threshold=threshold,
                                reset=reset,
                                refractory=refractory,
                                max_refractory=max_refractory,
                                compile=compile,
                                clock=simulator.state.network.clock,
                                max_delay=simulator.state.max_delay * ms,
                                implicit=implicit,
                                freeze=False)
     for name, value in parameters.items():
         setattr(self, name, value)
     self._S0 = self._S[:, 0]  # store parameter values in case of reset.
     # TODO: update this when parameters are modified
     self.initial_values = {}
예제 #2
0
 def __init__(self, n, equations, spiketimes=None):
     threshold = brian.directcontrol.MultipleSpikeGeneratorThreshold(
                                            [st.value for st in spiketimes])
     reset = brian.NoReset()
     refractory = 0*ms
     BaseNeuronGroup.__init__(self, n,
                              brian.LazyStateUpdater(),
                              threshold, reset, refractory,
                              spiketimes=spiketimes)
예제 #3
0
 def __init__(self, n, equations, **parameters):
     threshold = brian.PoissonThreshold()
     reset = brian.NoReset()
     refractory = 0*ms
     BaseNeuronGroup.__init__(self, n,
                              brian.LazyStateUpdater(),
                              threshold, reset, refractory,
                              **parameters)
     self.initialize()