-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_common.py
More file actions
51 lines (46 loc) · 1.41 KB
/
test_common.py
File metadata and controls
51 lines (46 loc) · 1.41 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
import sys
import os
import logging
import testoob
import node
import bpg
import sim
def setup_logging():
rootlogger = logging.getLogger()
level = logging.ERROR
if '-d' in sys.argv:
level = logging.DEBUG
sys.argv.remove('-d')
rootlogger.setLevel(level)
for m in 'sim', 'glwidget', 'bpg', 'neural', 'qtapp':
l = logging.getLogger(m)
l.setLevel(level)
logging.basicConfig()
new_node_args_sigmoid = { 'weightDomain' : (-7,7),
'quanta': None }
new_node_args_logical = {'quanta':2}
new_network_args = { 'num_nodes' : 5,
'num_inputs' : 2,
'num_outputs' : 3,
'new_node_class': node.SigmoidNode,
'new_node_args' : new_node_args_sigmoid,
'topology' : '1d',
'update_style' : 'async',
'radius' : 1,
'uniform' : 1 }
new_individual_fn = bpg.BodyPartGraph
new_individual_args = { 'network_args' : new_network_args }
new_sim_fn = sim.BpgSim
new_sim_args = { 'max_simsecs' : 10,
'noise_sd' : 0.01 }
interactive = 0
def test_main():
if not os.path.exists('test'):
os.mkdir('test')
if '-i' in sys.argv:
global interactive
interactive = 1
sys.argv.remove('-i')
setup_logging()
logging.getLogger('ZEO').setLevel(logging.WARNING)
testoob.main()