summaryrefslogtreecommitdiff
path: root/src/genome/genome.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/genome/genome.js')
-rw-r--r--src/genome/genome.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/genome/genome.js b/src/genome/genome.js
index d35b68c..16b5e4d 100644
--- a/src/genome/genome.js
+++ b/src/genome/genome.js
@@ -120,3 +120,12 @@ export function mut_genome_insert(
[...genome, [source, sink, weight]],
];
}
+
+
+export function mut_genome_delete(
+ [n_input, n_internal, n_output, genome], r
+) {
+ const del_idx = Math.floor(r * genome.length);
+ const new_genome = genome.filter((_, idx) => idx != del_idx);
+ return [n_input, n_internal, n_output, new_genome];
+}