From 0460985d38d137fd02db4919c66d316a83d2919e Mon Sep 17 00:00:00 2001 From: sanine-a Date: Thu, 10 Aug 2023 14:57:01 -0500 Subject: use average weight in mutation and add README.md --- src/genome/genome.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/genome/genome.js') 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}'`); -- cgit v1.2.1