summaryrefslogtreecommitdiff
path: root/src/Genome.hs
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2023-11-29 12:41:09 -0600
committersanine <sanine.not@pm.me>2023-11-29 12:41:09 -0600
commit62a04f27ecbaf714c08fa0594566da83581f7a97 (patch)
tree60b399143cd9137aa02816a6d5daf680c1beb153 /src/Genome.hs
parentfa28b97de15b00946788f4f78cf932bc202f4811 (diff)
implement mutateGenomeAddInternal
Diffstat (limited to 'src/Genome.hs')
-rw-r--r--src/Genome.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Genome.hs b/src/Genome.hs
index 4fb063c..c3fc361 100644
--- a/src/Genome.hs
+++ b/src/Genome.hs
@@ -5,6 +5,8 @@ module Genome
, mutateGeneSink
, mutateGeneWeight
, mutateGene
+
+ , mutateGenomeAddInternal
) where
@@ -67,3 +69,12 @@ mutateGene :: RandomGen a => Genome -> Gene -> a -> (Gene, a)
mutateGene genome g r =
let (f, r') = randomChoice [mutateGeneSource, mutateGeneSink, mutateGeneWeight] r
in f genome g r'
+
+-- add new internal neuron
+mutateGenomeAddInternal :: RandomGen a => Genome -> a -> (Genome, a)
+mutateGenomeAddInternal genome r = (genome { numInternal = 1 + numInternal genome }, r)
+
+
+-- remove an internal neuron, decrementing sources and incrementing sinks
+mutateGenomeRemoveInternal :: RandomGen a => Genome -> a -> (Genome, a)
+mutateGenomeRemoveInternal = undefined