def test_random(self): btsr = BehaviorTreeStringRepresentation([]) random.seed(1337) for length in range(1, 11): btsr.random(length) assert btsr.length() == length assert btsr.is_valid()
def random_genome(self, length): """ Returns a random genome """ bt = BehaviorTreeStringRepresentation([]) return bt.random(length)