Changeset 1103
- Timestamp:
- 03/22/12 00:07:45 (14 months ago)
- Location:
- trunk/src/nemo
- Files:
-
- 2 modified
-
__init__.py (modified) (3 diffs)
-
simulator.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/nemo/__init__.py
r1102 r1103 125 125 cell.parent = self 126 126 if isinstance(celltype, SpikeSourcePoisson): 127 simulator.spikes_array_list += self.all_cells.tolist() 128 params['precision'] = simulator.state.dt 129 ntype = simulator.state.net.add_neuron_type('Input') 130 for idx in self.all_cells: 131 player = SpikeSourcePoisson.spike_player(**params) 132 setattr(idx, 'player', player) 133 simulator.state.net.add_neuron(ntype, list(self.all_cells)) 127 ntype = simulator.state.net.add_neuron_type('PoissonSource') 128 simulator.state.net.add_neuron(ntype, list(self.all_cells), [params['rate']]*n) 134 129 elif isinstance(celltype, SpikeSourceArray): 135 ### For the moment, we model spike_source_array and spike_source_poisson 136 ### as hyperpolarized neurons that are forced to fire, but this could be 137 ### enhanced. A local copy of these devices is kept on the CPU, to send the 130 ### For the moment, we model spike_source_array as neurons that are forced to fire, 131 ### but this could be enhanced. A local copy of these devices is kept on the CPU, to send the 138 132 ### spikes 139 133 simulator.spikes_array_list += self.all_cells.tolist() 140 134 params['precision'] = simulator.state.dt 141 ntype = simulator.state.net.add_neuron_type('Input')135 ntype = simulator.state.net.add_neuron_type('Input') 142 136 for idx in self.all_cells: 143 137 player = SpikeSourceArray.spike_player(**params) … … 146 140 elif isinstance(celltype, cells.IF_curr_exp): 147 141 init = celltype.default_initial_values 148 ntype = simulator.state.net.add_neuron_type('IF_curr_exp')142 ntype = simulator.state.net.add_neuron_type('IF_curr_exp') 149 143 simulator.state.net.add_neuron(ntype, list(self.all_cells), 150 144 [params['v_rest']]*n, … … 158 152 [params['i_offset']]*n, 159 153 [init['v']]*n, [0.]*n, [0.]*n, [1000.]*n) 160 el se:154 elif isinstance(celltype, cells.Izikevich): 161 155 init = celltype.default_initial_values 162 156 ntype = simulator.state.net.add_neuron_type('Izhikevich') -
trunk/src/nemo/simulator.py
r1099 r1103 144 144 if isinstance(self.celltype, SpikeSourceArray): 145 145 return {'spike_times' : self.player.spike_times} 146 elif isinstance(self.celltype, SpikeSourcePoisson):147 return {'rate' : self.player.rate, 'duration' : self.player.duration,148 'start' : self.player.start}149 146 else: 150 147 params = {} … … 160 157 parameters['precision'] = state.dt 161 158 self.player.reset(**parameters) 162 elif isinstance(self.celltype, SpikeSourcePoisson):163 parameters['precision'] = state.dt164 self.player.reset(**parameters)165 159 else: 166 160 indices = self.celltype.indices
