diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2015-05-28 17:08:46 +0200 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2015-05-28 17:08:46 +0200 |
commit | eacf2017413f590e69e841480ae47a9ebdc769cd (patch) | |
tree | 0adfa0d37b2353959c7d2adef635ab38f005494d | |
parent | 55386cb28e2512804f1c09097be8348f64ca8c00 (diff) | |
download | pucket-eacf2017413f590e69e841480ae47a9ebdc769cd.tar.gz pucket-eacf2017413f590e69e841480ae47a9ebdc769cd.tar.bz2 pucket-eacf2017413f590e69e841480ae47a9ebdc769cd.zip |
random: Remove variation bias
-rw-r--r-- | genome.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -277,8 +277,9 @@ void xform_rand (flam3_xform * const xform, const bool add_post, } } + const unsigned int var = rand_mod (rc, max_var)+1; memset (xform->var, 0, sizeof (*xform->var)); - for (unsigned int i = 0; i < max_var; i++) { + for (unsigned int i = 0; i < var; i++) { const unsigned int v = rand_mod (rc, flam3_nvariations); double w; do { @@ -286,11 +287,6 @@ void xform_rand (flam3_xform * const xform, const bool add_post, } while (w == 0.0); xform->var[v] += w; random_xform_param (xform, v, rc); - - /* small number of variations is more likely */ - if (rand_bool (rc)) { - break; - } } /* Normalize weights to 1.0 total. */ |