- Timestamp:
- 11/28/11 14:15:15 (6 months ago)
- Location:
- trunk/src/nemo
- Files:
-
- 4 modified
-
__init__.py (modified) (2 diffs)
-
recording.py (modified) (2 diffs)
-
simulator.py (modified) (5 diffs)
-
standardmodels/cells.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/nemo/__init__.py
r1014 r1017 136 136 elif isinstance(celltype, cells.IF_curr_exp): 137 137 init = celltype.default_initial_values 138 for idx in self.all_cells: 139 ntype = simulator.state.net.add_neuron_type('IF_curr_exp') 138 for idx in self.all_cells: 139 ntype = simulator.state.net.add_neuron_type('IF_curr_exp') 140 140 simulator.state.net.add_neuron(ntype, int(idx), 141 141 params['v_rest'], 142 params['v_reset'], 142 143 params['cm'], 143 params['tau_m'], 144 params['tau_m'], 144 145 params['t_refrac'], 145 146 params['tau_syn_E'], 146 147 params['tau_syn_I'], 147 params['i_offset'],148 params['v_reset'],149 148 params['v_thresh'], 150 init['v'], 0., 0., 1000.) 149 params['i_offset'], 150 init['v'], 0., 0., -1.) 151 151 else: 152 152 init = celltype.default_initial_values … … 162 162 if not hasattr(value, "__len__"): 163 163 value = value*numpy.ones((len(self),)) 164 164 for cell, val in zip(self, value): 165 cell.set_initial_value(variable, val) 165 166 166 167 class Projection(common.Projection): -
trunk/src/nemo/recording.py
r1000 r1017 21 21 __doc__ = recording.Recorder.__doc__ 22 22 recording.Recorder.__init__(self, variable, population, file) 23 s imulator.recorder_list.append(self)23 self._simulator.recorder_list.append(self) 24 24 self.data = {} 25 self.times = [] 26 25 self.times = [] 26 27 27 def record(self, ids): 28 28 """Add the cells in `ids` to the set of recorded cells.""" … … 46 46 def _add_vm(self, time): 47 47 for id in list(self.recorded): 48 self.data[id] += [s imulator.state.sim.get_membrane_potential(int(id))]48 self.data[id] += [self._simulator.state.sim.get_membrane_potential(int(id))] 49 49 self.times += [time] 50 50 -
trunk/src/nemo/simulator.py
r998 r1017 60 60 self.simulation = None 61 61 self.stdp = None 62 self.verbose = True62 self.verbose = False 63 63 64 64 def progressbar(self, N): … … 87 87 88 88 def run(self, simtime): 89 89 90 self.simulation = nemo.Simulation(self.net, self.conf) 90 91 if self.verbose: … … 111 112 spikes += [source] 112 113 113 #for currents in current_sources:114 # currents.115 114 fired = numpy.sort(self.sim.step(spikes, currents)) 116 115 … … 118 117 self.simulation.apply_stdp(1.0) 119 118 120 for recorder in recorder_list :119 for recorder in recorder_list[1:]: 121 120 if recorder.variable is "spikes": 122 121 recorder._add_spike(fired, self.t) … … 179 178 180 179 def set_initial_value(self, variable, value): 181 indices = self.celltype.in dices.items()180 indices = self.celltype.initial_indices 182 181 if state.simulation is None: 183 182 state.net.set_neuron_state(self, indices[variable], value) -
trunk/src/nemo/standardmodels/cells.py
r1013 r1017 41 41 42 42 indices = {'a' : 0, 'b' : 1, 'c' : 2, 'd' : 3} 43 44 43 initial_indices = {'u' : 0, 'v' : 1} 45 44 … … 152 151 indices = { 153 152 'v_rest' : 0, 154 'cm' : 1,155 'tau_m' : 2,156 't_refrac' : 3,157 'tau_syn_E' : 4,158 'tau_syn_I' : 5,159 'i_offset' : 6,160 'v_reset' : 7,161 'v_thresh' : 8153 'cm' : 2, 154 'tau_m' : 3, 155 't_refrac' : 4, 156 'tau_syn_E' : 5, 157 'tau_syn_I' : 6, 158 'i_offset' : 8, 159 'v_reset' : 1, 160 'v_thresh' : 7 162 161 } 162 163 163 initial_indices = {'v' : 0} 164 164
