def _local_run(self): ''' pyNN lazy array demands a minimum population size of 3. Why is that. ''' import numpy as np results = {} #self.population.record('v') #self.population.record('spikes') # For ome reason you need to record from all three neurons in a population # In order to get the membrane potential from only the stimulated neuron. self.population[0:2].record(('v', 'spikes', 'u')) ''' self.Iz.record('v') self.Iz.record('spikes') # For ome reason you need to record from all three neurons in a population # In order to get the membrane potential from only the stimulated neuron. self.Iz.record(('v', 'spikes','u')) ''' #self.neuron.run(650.0) DURATION = 1000.0 self.neuron.run(DURATION) # run the simulation and retrieve the recorded data sim.run(t_stop) data = neuron.get_data().segments[0] data = self.neuron.get_data().segments[0] vm = data.filter(name="v")[0] #/10.0 results['vm'] = vm / 1000.0 #print(vm) sample_freq = DURATION / len(vm) results['t'] = vm.times #np.arange(0,len(vm),DURATION/len(vm)) results['run_number'] = results.get('run_number', 0) + 1 return results
def test_run(): simulator.reset() simulator.run(12.3) assert_almost_equal(h.t, 12.3, places=11) simulator.run(7.7) assert_almost_equal(h.t, 20.0, places=11)
def run(simtime): """Run the simulation for simtime ms.""" simulator.run(simtime) return get_current_time()