From 1ad77cbdadb6e8c389c128b0f95907505e1b22ca Mon Sep 17 00:00:00 2001 From: sanine-a Date: Thu, 10 Aug 2023 15:39:56 -0500 Subject: refactor: is_valid -> get_size() --- src/genome/genome.test.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/genome/genome.test.js') diff --git a/src/genome/genome.test.js b/src/genome/genome.test.js index f50531b..0ad8d80 100644 --- a/src/genome/genome.test.js +++ b/src/genome/genome.test.js @@ -2,7 +2,7 @@ import { mutation_type, mutate, - is_valid, + get_size, } from './genome'; @@ -23,9 +23,14 @@ test('basic gene mutations', () => { }); -test('genome validation', () => { - expect(is_valid(0, 0, [ [ 0, 0, 1.0 ] ])).toBe(true); - expect(is_valid(2, 1, [ [ 0, 2, 1 ] ])).toBe(true); - expect(is_valid(2, 1, [ [ 0, 1, 1 ] ])).toBe(false); - expect(is_valid(2, 1, [ [ 0, 2, 5 ] ])).toBe(false); +test('genome validation and size', () => { + expect(get_size(0, 0, [ [ 0, 0, 1.0 ] ])).toBe(1); + expect(get_size(2, 1, [ [ 0, 2, 1 ] ])).toBe(3); + expect(get_size(2, 1, [ [ 0, 1, 1 ] ])).toBe(-1); + expect(get_size(2, 1, [ [ 0, 2, 5 ] ])).toBe(-1); +}); + + +test('parse a genome into a neural net', () => { + }); -- cgit v1.2.1