def _set_state(self, s):

        # copies most recent state
        data = self.game_state.data
        agent_states = data.agentStates

        # set pacman position
        agent_states.configuration.pos = (s[0], s[1])

        # set ghost position
        num_ghosts = len(agent_states) - 1
        for i in range(1, num_ghosts + 1):
            part_s = s[(3 * i) - 1:3 * i]
            agent_states[i].configuration.pos = (part_s[0], part_s[1])
            agent_states[i].scaredTimer = part_s[2]

        # set food and capsules locations
        s_food = s[(num_ghosts + 1) * 3:]
        x = 0
        y = 0
        i = 0
        data.capsules = []
        for char in str(self.layout_copy):
            if char == ".":
                data.food[x][y] = bool(s_food[i])
                i += 1
            elif char == "o":
                coord = (x, self.layout_copy.height - y)
                if s_food[i]:
                    data.capsules.append(coord)
                i += 1
            elif char == "\n":
                y += 1
                x = -1
            x += 1
Takes a vector s and sets the internal game state used by the original
dataset/ETHPy150Open rlpy/rlpy/rlpy/Domains/Pacman.py/Pacman._set_state