summaryrefslogtreecommitdiff
path: root/src/genome/genome.js
diff options
context:
space:
mode:
authorsanine-a <sanine.not@pm.me>2023-08-10 14:57:01 -0500
committersanine-a <sanine.not@pm.me>2023-08-10 14:57:01 -0500
commit0460985d38d137fd02db4919c66d316a83d2919e (patch)
tree736af5601d2fac8cc570c9da7a840e6b5607a688 /src/genome/genome.js
parenteb03b3a341f3c8152db4ee2ee99b85cffb27796e (diff)
use average weight in mutation and add README.md
Diffstat (limited to 'src/genome/genome.js')
-rw-r--r--src/genome/genome.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/genome/genome.js b/src/genome/genome.js
index 8e0c9f0..e2bf83e 100644
--- a/src/genome/genome.js
+++ b/src/genome/genome.js
@@ -41,7 +41,7 @@ export function mutate(gene, type, value) {
case mutation_type.weight:
const w = (8*value) - 4;
- return [ source, sink, w ];
+ return [ source, sink, 0.5*(w + weight) ];
default:
throw new Error(`unknown mutation type: '${type}'`);