Changeset 997
- Timestamp:
- 10/03/11 17:06:43 (8 months ago)
- Location:
- trunk
- Files:
-
- 3 modified
-
src/common.py (modified) (1 diff)
-
src/random.py (modified) (1 diff)
-
test/unittests/test_random.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common.py
r993 r997 328 328 Connect a source of spikes to a synaptic target. 329 329 330 source and target can both be individual cells or lists of cells, in331 which case all possible connections are made with probability p, using332 either the random number generator supplied, or the default rng333 otherwise. Weights should be in nA or µS.330 source and target can both be individual cells or populations/assemblies 331 of cells, in which case all possible connections are made with 332 probability p, using either the random number generator supplied, or the 333 default rng otherwise. Weights should be in nA or µS. 334 334 """ 335 335 if isinstance(source, IDMixin): -
trunk/src/random.py
r980 r997 42 42 logger = logging.getLogger("PyNN") 43 43 44 class AbstractRNG :44 class AbstractRNG(object): 45 45 """Abstract class for wrapping random number generators. The idea is to be 46 46 able to use either simulator-native rngs, which may be more efficient, or a -
trunk/test/unittests/test_random.py
r818 r997 168 168 rng=self.rnglist[0], boundaries=[0.0, 1.0], 169 169 constrain="clip") 170 vals = rd.next(100 )170 vals = rd.next(1000) 171 171 assert vals.min() == 0 172 172 assert vals.max() < 1.0 … … 175 175 rng=self.rnglist[0], boundaries=[0.0, 1.0], 176 176 constrain="redraw") 177 vals = rd.next(100 )177 vals = rd.next(1000) 178 178 assert vals.min() >= 0 179 179 assert vals.max() < 1.0 180 assert abs(vals.mean() - 0.5) < 0.05 180 assert abs(vals.mean() - 0.5) < 0.05, vals.mean() 181 181 val = rd.next() 182 182 rd = random.RandomDistribution(distribution='uniform', parameters=[-1.0, 1.0],
