summaryrefslogtreecommitdiff
path: root/src/Genome.hs
diff options
context:
space:
mode:
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