10
10
class TestPlastiCoding (unittest .TestCase ):
11
11
def setUp (self ):
12
12
self .conf = pyrevolve .genotype .plasticoding .plasticoding .PlasticodingConfig ()
13
- self .genotype = pyrevolve .genotype .plasticoding .plasticoding .initialization .random_initialization (self .conf )
13
+ self .genotype = pyrevolve .genotype .plasticoding .plasticoding .initialization .random_initialization (self .conf , 176 )
14
14
15
15
def test_development (self ):
16
16
robot = self .genotype .develop ()
@@ -33,7 +33,7 @@ def test_read_write_file(self):
33
33
34
34
self .genotype .export_genotype (file1 )
35
35
36
- genotype2 = pyrevolve .genotype .plasticoding .plasticoding .Plasticoding (self .conf )
36
+ genotype2 = pyrevolve .genotype .plasticoding .plasticoding .Plasticoding (self .conf , self . genotype . id )
37
37
genotype2 .id = self .genotype .id
38
38
genotype2 .load_genotype (file1 )
39
39
genotype2 .export_genotype (file2 )
@@ -47,8 +47,7 @@ def test_read_write_file(self):
47
47
file2_txt .close ()
48
48
49
49
def test_collision (self ):
50
- genotype_180 = pyrevolve .genotype .plasticoding .plasticoding .Plasticoding (self .conf )
51
- genotype_180 .id = "genotype{}" .format (180 )
50
+ genotype_180 = pyrevolve .genotype .plasticoding .plasticoding .Plasticoding (self .conf , 180 )
52
51
genotype_180 .load_genotype (os .path .join (LOCAL_FOLDER , 'genotype_180.txt' ))
53
52
robot = genotype_180 .develop ()
54
53
robot .update_substrate (raise_for_intersections = True )
@@ -58,8 +57,8 @@ class Test176(unittest.TestCase):
58
57
def setUp (self ):
59
58
self .conf = pyrevolve .genotype .plasticoding .plasticoding .PlasticodingConfig ()
60
59
61
- self . genotype = pyrevolve . genotype . plasticoding . plasticoding . Plasticoding ( self . conf )
62
- self .genotype . id = " genotype{}" . format ( 176 )
60
+ _id = 176
61
+ self .genotype = pyrevolve . genotype . plasticoding . plasticoding . Plasticoding ( self . conf , _id )
63
62
self .genotype .load_genotype (os .path .join (LOCAL_FOLDER , 'genotype_176.txt' ))
64
63
65
64
self .robot = self .genotype .develop ()
0 commit comments