예제 #1
0
 def test_reset_guess_it(self):
     gi = TwoPlayerGuessIt()
     p = UninformedMCTSPlayer(gi, 2)
     init = gi.get_initial_state()
     s = p.update_state(init)
     s_gt = init.copy()
     s_gt[0, 0, 0] = 1
     s_gt[:, :, -1] = 1
     self.assertTrue((s == s_gt).all())
     for _ in range(100):
         p.reset()
         s = p.update_state(init)
     self.assertTrue((s == s_gt).all())
예제 #2
0
 def test_two_sim_guess_it(self):
     gi = TwoPlayerGuessIt()
     p = UninformedMCTSPlayer(gi, 2)
     init = gi.get_initial_state()
     s = p.update_state(init)
     s_gt = init
     s_gt[0, 0, 0] = 1
     s_gt[:, :, -1] = 1
     self.assertTrue((s == s_gt).all())
예제 #3
0
 def test_six_sim_guess_it(self):
     for _ in range(1000):  # There should be no stochasticity (temp=0)
         gi = TwoPlayerGuessIt()
         p = UninformedMCTSPlayer(gi, 6)
         init = gi.get_initial_state()
         s = p.update_state(init)
         s_gt = init
         s_gt[-1, -1, 0] = 1
         s_gt[:, :, -1] = 1
         self.assertTrue((s == s_gt).all())