Changeset 896 for cpp/frams/neuro


Ignore:
Timestamp:
11/30/19 01:30:22 (4 years ago)
Author:
Maciej Komosinski
Message:

Replaced #defined macros for popular random-related operations with functions

Location:
cpp/frams/neuro
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/neuro/impl/neuroimpl-simple.h

    r791 r896  
    7777public:
    7878        NeuroImpl* makeNew() { return new NI_Random(); };
    79         void go() { setState(rnd01*2.0 - 1.0); }
     79        void go() { setState(rndDouble(2) - 1.0); }
    8080};
    8181
  • cpp/frams/neuro/neuroimpl.cpp

    r732 r896  
    8585        for (i = 0; n = mod.getNeuro(i); i++)
    8686        {
    87                 n->state += (rnd01 - 0.5)*config.randominit;
     87                n->state += (rndDouble(1) - 0.5)*config.randominit;
    8888                ni = (NeuroImpl*)n->userdata[mytags_id];
    8989                if (!ni) continue;
Note: See TracChangeset for help on using the changeset viewer.