Changeset 896 for cpp/frams/genetics/fn


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/fn/fn_oper.cpp

    r809 r896  
    55#include "fn_oper.h"
    66#include "fn_conv.h"
    7 #include <common/nonstd.h> //randomN, rnd01
     7#include <common/nonstd.h> //rndUint, rnd01
    88
    99
     
    8080        if (mut_single_var) //mutate only one, randomly selected variable
    8181        {
    82                 int which = randomN(values.size());
     82                int which = rndUint(values.size());
    8383                values[which] = GenoOperators::mutateCreep('f', values[which], bound_low[which], bound_high[which], stddev[which], false);
    8484                chg = 1.0f / values.size();
     
    103103        //xover_proportion = 0.1; //testing...
    104104
    105         double proportion = xover_proportion_random ? 0.5 + rnd0N(0.5) : xover_proportion;
     105        double proportion = xover_proportion_random ? 0.5 + rndDouble(0.5) : xover_proportion;
    106106
    107107        chg1 = proportion;
Note: See TracChangeset for help on using the changeset viewer.