-
Notifications
You must be signed in to change notification settings - Fork 0
/
merk.py
39 lines (26 loc) · 863 Bytes
/
merk.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import neuralnetwork
import genome
import random
import nnbuilder
import stagevars
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
class Merk:
# ------------------------------------------------ #
def __init__(self):
self.nn = neuralnetwork.Neuralnetwork()
self.gen = genome.Genome(auto_initialize=False)
self.svars = stagevars.Stagevars()
# ------------------------------------------------ #
def build_random_merk(self):
self.gen.random_adn()
self.gen.make_clean_rules()
nnbuilder.build_nn(self.nn, self.gen, verbose=False)
# ------------------------------------------------ #
def action(self):
self.svars.action()
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #
def example():
random.seed(5)
a = Merk()
a.build_random_merk()
print(a.nn.links)