def test_vector_to_instance(self): num_states = 4 vector = [random.random() for _ in range(num_states * 4 + 1)] fsm_params = FSMParams(num_states=4) fsm_params.receive_vector(vector=vector) instance = fsm_params.player() self.assertIsInstance(instance, axl.FSMPlayer)
def test_player(self): num_states = 2 rows = [[0, C, 1, D], [0, D, 0, D], [1, C, 1, C], [1, D, 1, D]] fsm_params = FSMParams(num_states=num_states, rows=rows) self.assertEqual(fsm_params.player(), axl.FSMPlayer(rows, initial_state=0))