Exemple #1
0
def simple_gene_spawner(atoms):
    i_set = InstructionSet()
    i_set.register_list([atoms["add"], atoms["sub"], atoms["if"]])
    l_set = [5, 1.2, True]
    return GeneSpawner(i_set, l_set, [random.random])
Exemple #2
0
 def test_register_list(self, instr_set):
     i_set = InstructionSet()
     i_set.register_list([instr_set["int_add"], instr_set["int_sub"]])
     assert len(i_set) == 2
Exemple #3
0
def simple_gene_spawner(instr_set):
    i_set = InstructionSet()
    i_set.register_list([instr_set["int_add"], instr_set["int_sub"], instr_set["exec_if"]])
    l_set = [5, 1.2, True]
    return GeneSpawner(1, i_set, l_set, [random.random])
Exemple #4
0
 def test_register_list(self, atoms):
     i_set = InstructionSet()
     i_set.register_list([atoms["add"], atoms["sub"]])
     assert len(i_set) == 2
Exemple #5
0
 def test_register_list(self, atoms):
     i_set = InstructionSet()
     i_set.register_list([atoms["add"], atoms["sub"]])
     assert len(i_set) == 2
Exemple #6
0
def simple_gene_spawner(atoms):
    i_set = InstructionSet()
    i_set.register_list([atoms["add"], atoms["sub"], atoms["if"]])
    l_set = [atoms["5"], atoms["1.2"], atoms["true"]]
    return GeneSpawner(i_set, l_set, [random.random])