예제 #1
0
def test_run():
    ch = Chromosome(2, 1)
    ch.random(c)
    ch.outputs[0] = 2
    ch.nodes[2].x = 0
    ch.nodes[2].y = 1
    ch.nodes[2].function = tf.square
    ch.nodes[2].arity = 1
    outv = ch.run()
    print(outv)
    assert outv == ch.nodes[2].param
예제 #2
0
def test_multiout_run():
    ch = Chromosome(10, 10)
    ch.random(c)
    outv = ch.run()
    print(outv)
    assert len(outv) > 1