Changeset 104 for cpp/gdk/neuroimpl.cpp
- Timestamp:
- 07/23/13 18:15:30 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/gdk/neuroimpl.cpp
r81 r104 32 32 #undef FIELDSTRUCT 33 33 34 NeuroNetConfig::NeuroNetConfig( )34 NeuroNetConfig::NeuroNetConfig(NeuroFactory *fac) 35 35 :par(nncfg_paramtab,this), 36 36 randominit(0.01), 37 37 nnoise(0), 38 touchrange(1) 38 touchrange(1), 39 factory(fac) 39 40 {} 40 41 NeuroNetConfig& NeuroNetConfig::getGlobalConfig()42 {43 static NeuroNetConfig globalconfig;44 return globalconfig;45 }46 41 47 42 ///////////////////////////////////////////////////////////////// … … 74 69 for (i=0;n=mod.getNeuro(i);i++) 75 70 { 76 ni= NeuroFactory::createNeuroImpl(n);71 ni=conf.factory->createNeuroImpl(n); 77 72 n->userdata[mytags_id]=ni; 78 73 if (!ni) { errorcount++; … … 205 200 chstate=chnewstate; 206 201 neuro->state=newstate; 207 if ( NeuroNetConfig::getGlobalConfig().nnoise>0.0)202 if (owner->getConfig().nnoise>0.0) 208 203 { 209 neuro->state+=RndGen.GaussStd()* NeuroNetConfig::getGlobalConfig().nnoise;204 neuro->state+=RndGen.GaussStd()*owner->getConfig().nnoise; 210 205 if (channels>1) 211 206 for(int i=0;i<chstate.size();i++) 212 chstate(0)+=RndGen.GaussStd()* NeuroNetConfig::getGlobalConfig().nnoise;207 chstate(0)+=RndGen.GaussStd()*owner->getConfig().nnoise; 213 208 } 214 209 } … … 272 267 void NeuroImpl::readParam() 273 268 { 274 staticParam par;269 Param par; 275 270 if (!paramentries) return; 276 271 par.setParamTab(paramentries);
Note: See TracChangeset
for help on using the changeset viewer.