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.test.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/genome/genome.test.js') diff --git a/src/genome/genome.test.js b/src/genome/genome.test.js index 853d103..ca56092 100644 --- a/src/genome/genome.test.js +++ b/src/genome/genome.test.js @@ -14,7 +14,7 @@ test('basic gene mutations', () => { expect(mutate([0, 1, 2], mutation_type.sink, 0.8)).toEqual([0, 2, 2]); expect(mutate([0, 0, 2], mutation_type.sink, 0.2)).toEqual([0, 0, 2]); - expect(mutate([0, 1, 2], mutation_type.weight, 0.5)).toEqual([0, 1, 0]); - expect(mutate([0, 1, 2], mutation_type.weight, 0.0)).toEqual([0, 1, -4]); - expect(mutate([0, 1, 2], mutation_type.weight, 1.0)).toEqual([0, 1, 4]); + expect(mutate([0, 1, 2], mutation_type.weight, 0.5)).toEqual([0, 1, 1]); + expect(mutate([0, 1, 2], mutation_type.weight, 0.0)).toEqual([0, 1, -1]); + expect(mutate([0, 1, 2], mutation_type.weight, 1.0)).toEqual([0, 1, 3]); }); -- cgit v1.2.1