Esempio n. 1
0
 def test_get_hole_card_2_idx_lut(self):
     lg = _LutGetterHoldem(env_cls=DiscretizedNLHoldem)
     lut = lg.get_hole_card_2_idx_LUT()
     assert lut.shape == (52, 52)
     for i in range(52):
         for i2 in range(i + 1, 52):
             assert lut[i, i2] != -2
         for _i2 in range(0, i):
             assert lut[i, _i2] == -2
Esempio n. 2
0
    def test_get_lut_card_in_what_range_idxs(self):
        lg = _LutGetterHoldem(env_cls=DiscretizedNLHoldem)
        lut = lg.get_card_in_what_range_idxs_LUT()
        assert lut.shape == (52, 51)
        assert not np.any(lut == -2)

        counts = np.zeros(1326, np.int32)

        for c in range(52):
            for h in lut[c]:
                counts[h] += 1

        assert np.all(counts == 2)
Esempio n. 3
0
 def test_get_idx_2_hole_card_lut(self):
     lg = _LutGetterHoldem(env_cls=DiscretizedNLHoldem)
     lut = lg.get_idx_2_hole_card_LUT()
     assert lut.shape == (1326, 2)
     assert not np.any(lut == -2)