Changeset 104 for cpp/gdk/neuroimpl.cpp


Ignore:
Timestamp:
07/23/13 18:15:30 (11 years ago)
Author:
sz
Message:

introducing object de/serialization - see serialtest.cpp
the core GDK classes can be now used in multiple threads (ifdef MULTITHREADED)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/gdk/neuroimpl.cpp

    r81 r104  
    3232#undef FIELDSTRUCT
    3333
    34 NeuroNetConfig::NeuroNetConfig()
     34NeuroNetConfig::NeuroNetConfig(NeuroFactory *fac)
    3535        :par(nncfg_paramtab,this),
    3636         randominit(0.01),
    3737         nnoise(0),
    38          touchrange(1)
     38         touchrange(1),
     39         factory(fac)
    3940{}
    40 
    41 NeuroNetConfig& NeuroNetConfig::getGlobalConfig()
    42 {
    43 static NeuroNetConfig globalconfig;
    44 return globalconfig;
    45 }
    4641
    4742/////////////////////////////////////////////////////////////////
     
    7469for (i=0;n=mod.getNeuro(i);i++)
    7570        {
    76         ni=NeuroFactory::createNeuroImpl(n);
     71        ni=conf.factory->createNeuroImpl(n);
    7772        n->userdata[mytags_id]=ni;
    7873        if (!ni) { errorcount++;
     
    205200                chstate=chnewstate;
    206201        neuro->state=newstate;
    207         if (NeuroNetConfig::getGlobalConfig().nnoise>0.0)
     202        if (owner->getConfig().nnoise>0.0)
    208203                {
    209                 neuro->state+=RndGen.GaussStd()*NeuroNetConfig::getGlobalConfig().nnoise;
     204                neuro->state+=RndGen.GaussStd()*owner->getConfig().nnoise;
    210205                if (channels>1)
    211206                        for(int i=0;i<chstate.size();i++)
    212                                 chstate(0)+=RndGen.GaussStd()*NeuroNetConfig::getGlobalConfig().nnoise;
     207                                chstate(0)+=RndGen.GaussStd()*owner->getConfig().nnoise;
    213208                }
    214209        }
     
    272267void NeuroImpl::readParam()
    273268{
    274 static Param par;
     269Param par;
    275270if (!paramentries) return;
    276271par.setParamTab(paramentries);
Note: See TracChangeset for help on using the changeset viewer.