Example #1
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)
Example #2
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()
Example #3
0
 def __init__(self, spiketimes):
     thresh = brian.directcontrol.MultipleSpikeGeneratorThreshold(
         spiketimes)
     brian.NeuronGroup.__init__(self,
                                len(spiketimes),
                                model=brian.LazyStateUpdater(),
                                threshold=thresh,
                                clock=state.simclock,
                                max_delay=state.max_delay * ms)
     self.parameter_names = ['spiketimes']
Example #4
0
 def __init__(self, spiketimes):
     try:
         clock = state.simclock
         max_delay = state.max_delay*ms
     except Exception:
         raise Exception("Simulation timestep not yet set. Need to call setup()")
     thresh = brian.directcontrol.MultipleSpikeGeneratorThreshold(spiketimes)
     brian.NeuronGroup.__init__(self, len(spiketimes),
                                model=brian.LazyStateUpdater(),
                                threshold=thresh,
                                clock=clock,
                                max_delay=max_delay)
     self.parameter_names = ['spiketimes']
Example #5
0
 def __init__(self, N, rates=0):
     try:
         clock = state.simclock
         max_delay = state.max_delay*ms
     except Exception:
         raise Exception("Simulation timestep not yet set. Need to call setup()")
     brian.NeuronGroup.__init__(self, N, model=brian.LazyStateUpdater(),
                                threshold=brian.PoissonThreshold(),
                                clock=clock,
                                max_delay=max_delay)
     self._variable_rate = True
     self.rates          = rates
     self._S0[0]         = self.rates(self.clock.t)
     self.parameter_names = ['rate', 'start', 'duration']
Example #6
0
 def __init__(self, N, rates=0):
     brian.NeuronGroup.__init__(self,
                                N,
                                model=brian.LazyStateUpdater(),
                                threshold=brian.PoissonThreshold(),
                                clock=state.simclock,
                                max_delay=state.max_delay * ms)
     if callable(rates):  # a function is passed
         self._variable_rate = True
         self.rates = rates
         self._S0[0] = self.rates(self.clock.t)
     else:
         self._variable_rate = False
         self._S[0, :] = rates
         self._S0[0] = rates
     #self.var_index = {'rate':0}
     self.parameter_names = ['rate', 'start', 'duration']