diff options
author | sanine-a <sanine.not@pm.me> | 2023-08-10 15:39:56 -0500 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2023-08-10 15:39:56 -0500 |
commit | 1ad77cbdadb6e8c389c128b0f95907505e1b22ca (patch) | |
tree | 5d147fed3c2c7f69801a14017061fd433df89292 /src/genome/genome.test.js | |
parent | 49312fea07e56e2d74179f4160a16cac6f614f97 (diff) |
refactor: is_valid -> get_size()
Diffstat (limited to 'src/genome/genome.test.js')
-rw-r--r-- | src/genome/genome.test.js | 17 |
1 files changed, 11 insertions, 6 deletions
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', () => {
+
});
|