Im trying to instantiate a distributed mechanism that continuously injects random noise into an IAF cell. To generate a random sample for the noise, Im passing in a random object from python. In the mod file for the noise mechanism, this is handled identically to the random variable in netstim.mod.
Code: Select all
FUNCTION randGen() {
VERBATIM
if (_p_randObjPtr) {
/*
:Supports separate independent but reproducible streams for
: each instance. However, the corresponding hoc Random
: distribution MUST be set to Random.uniform(0,1)
*/
_lrandGen = nrn_random_pick(_p_randObjPtr);
}else{
hoc_execerror("Random object ref not set correctly for randObjPtr"," only via hoc Random");
}
ENDVERBATIM
}
PROCEDURE setRandObjRef() {
VERBATIM
void** pv = (void**)(&_p_randObjPtr);
if (ifarg(1)) {
*pv = nrn_random_arg(1);
}else{
*pv = (void*)0;
}
ENDVERBATIM
}
Code: Select all
self.soma.insert('NOISE')
self.noiseRandObj.uniform(0,1)
self.soma.setdata_NOISE(0.5)
self.soma.setRandObjRef_NOISE(self.noiseRandObj)
However, Im unable to gain access to any of the noise mechanisms custom procedures in python:
Code: Select all
File "cells.py", line 77, in biophys
self.soma.setdata_NOISE(0.5)
AttributeError: 'nrn.Section' object has no attribute 'setdata_NOISE'
Thanks!