コード例 #1
0
 def __init__(self, env,
              channel_dimensions=(observation_preprocessing.SMM_WIDTH,
                                  observation_preprocessing.SMM_HEIGHT)):
   gym.ObservationWrapper.__init__(self, env)
   self._channel_dimensions = channel_dimensions
   shape=(self.env.unwrapped._config.number_of_players_agent_controls(),
          channel_dimensions[1], channel_dimensions[0],
          len(observation_preprocessing.get_smm_layers(
              self.env.unwrapped._config)))
   self.observation_space = gym.spaces.Box(
       low=0, high=255, shape=shape, dtype=np.uint8)
コード例 #2
0
 def __init__(self, env,
              channel_dimensions=(observation_preprocessing.SMM_WIDTH,
                                  observation_preprocessing.SMM_HEIGHT)):
   gym.ObservationWrapper.__init__(self, env)
   self._channel_dimensions = channel_dimensions
   action_shape = np.shape(self.env.action_space)
   shape = (action_shape[0] if len(action_shape) else 1, channel_dimensions[1],
            channel_dimensions[0],
            len(
                observation_preprocessing.get_smm_layers(
                    self.env.unwrapped._config)))
   self.observation_space = gym.spaces.Box(
       low=0, high=255, shape=shape, dtype=np.uint8)