コード例 #1
0
ファイル: temprl.py プロジェクト: cipollone/multinav
    def __init__(self, env: Env):
        """Initialize.

        :param env: gym environment to wrap.
        """
        ObservationWrapper.__init__(self, env)

        space = env.observation_space
        assert len(space) == 2, "Expected: environment state, automata states"
        assert type(space[0]) == Discrete, "Env state must be discrete"
        assert type(space[1]) == MultiDiscrete, "Automata states are discrete"

        self.observation_space = MultiDiscrete(
            (np.insert(space[1].nvec, 0, space[0].n)))
コード例 #2
0
ファイル: temprl.py プロジェクト: cipollone/multinav
    def __init__(self, env: Env):
        """Initialize.

        :param env: gym environment to wrap.
        """
        ObservationWrapper.__init__(self, env)

        space = env.observation_space
        assert len(space) == 2, "Expected: environment state, automata states"
        assert type(space[0]) == Box, "Env state must be a box"
        assert type(space[1]) == MultiDiscrete, "Automata states are discrete"

        automata_highs = space[1].nvec.astype(np.float32)
        automata_lows = np.zeros_like(automata_highs)
        automata_box = Box(automata_lows, automata_highs)

        self.observation_space = combine_boxes(space[0], automata_box)
コード例 #3
0
 def __init__(self, env):
     ObservationWrapper.__init__(self, env)
     self.observation_space = spaces.Box(
         low=0.0, high=1.0, shape=(84, 84), dtype=np.float32)
コード例 #4
0
 def __init__(self, env):
     ObservationWrapper.__init__(self, env)
     # Important so that gym's play.py picks up the right resolution
     self.observation_space = spaces.Box(low=0, high=255,
                                         shape=(84, 84),
                                         dtype=np.uint8)
コード例 #5
0
 def __init__(self, env):
     ObservationWrapper.__init__(self, env)
     self.frames_since_reset = None