예제 #1
0
    def test_normalize_all_zero(self):
        env_bldr = get_leduc_env_bldr()
        range_ = PokerRange(env_bldr=env_bldr)

        range_._range = np.zeros_like(range_._range)
        range_.normalize()
        np.testing.assert_allclose(np.sum(range_._range), 1, atol=0.0001)
예제 #2
0
    def test_normalize(self):
        env_bldr = get_leduc_env_bldr()
        range_ = PokerRange(env_bldr=env_bldr)

        range_._range = np.random.random(size=env_bldr.rules.RANGE_SIZE)
        range_.normalize()
        np.testing.assert_allclose(np.sum(range_._range), 1, atol=0.0001)