Example #1
0
 def test_move_gen_defector(self):
     """
     Tests the move_gen function when playing against a Defector player.
     """
     expected_output = [D, D, D, D]
     for inp, out in zip(self.input_pos, expected_output):
         out_move = dbs.move_gen(inp, self.defector_policy, depth_search_tree=5)
         self.assertEqual(out_move, out)
Example #2
0
 def test_move_gen_titForTat(self):
     """
     Tests the move_gen function when playing against a TitForTat player.
     """
     expected_output = [C, C, C, C]
     for inp, out in zip(self.input_pos, expected_output):
         out_move = dbs.move_gen(inp, self.titForTat_policy, depth_search_tree=5)
         self.assertEqual(out_move, out)
Example #3
0
 def test_move_gen_defector(self):
     """
     Tests the move_gen function when playing against a Defector player.
     """
     expected_output = [D, D, D, D]
     for inp, out in zip(self.input_pos, expected_output):
         out_move = dbs.move_gen(inp,
                                 self.defector_policy,
                                 depth_search_tree=5)
         self.assertEqual(out_move, out)
Example #4
0
 def test_move_gen_titForTat(self):
     """
     Tests the move_gen function when playing against a TitForTat player.
     """
     expected_output = [C, C, C, C]
     for inp, out in zip(self.input_pos, expected_output):
         out_move = dbs.move_gen(inp,
                                 self.titForTat_policy,
                                 depth_search_tree=5)
         self.assertEqual(out_move, out)