def test_phi_cells():
    mapDir = os.path.join(__rlpy_location__, "Domains", "GridWorldMaps")
    mapname=os.path.join(mapDir, "4x5.txt") # expect 4*5 = 20 states
    domain = GridWorld(mapname=mapname)

    rep = IndependentDiscretization(domain)

    for r in np.arange(4):
        for c in np.arange(5):
            phiVec = rep.phi(np.array([r,c]), terminal=False)
            assert sum(phiVec) == 2 # 1 for each dimension
            assert phiVec[r] == 1 # correct row activated
            assert phiVec[4+c] == 1 # correct col activated
Ensure correct features are activated for corresponding state
dataset/ETHPy150Open rlpy/rlpy/tests/test_representations/test_IndependentDiscretization.py/test_phi_cells