1ec706b27e4e165df197053b87ed7401db462eae,slm_lab/env/openai.py,OpenAIEnv,space_step,#OpenAIEnv#Any#,96

Before Change


    def space_step(self, action_e):
        action = action_e[(0, 0)]  // single body
        if self.done:  // space envs run continually without a central reset signal
            state_e = self.space_reset()
            _reward_e, done_e = self.env_space.aeb_space.init_data_s(["reward", "done"], e=self.e)
            return state_e, _reward_e, done_e, None
        if not self.is_discrete and self.action_dim == 1:  // guard for continuous with action_dim 1, make array
            action = np.expand_dims(action, axis=-1)
        state, reward, done, info = self.u_env.step(action)
        if self.reward_scale is not None:

After Change


        if not self.is_discrete and self.action_dim == 1:  // guard for continuous with action_dim 1, make array
            action = np.expand_dims(action, axis=-1)
        state, reward, done, info = self.u_env.step(action)
        if done:
            state = self.u_env.reset()
        if self.reward_scale is not None:
            reward *= self.reward_scale
        if self.to_render:
            self.u_env.render()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: kengz/SLM-Lab
Commit Name: 1ec706b27e4e165df197053b87ed7401db462eae
Time: 2019-05-06
Author: kengzwl@gmail.com
File Name: slm_lab/env/openai.py
Class Name: OpenAIEnv
Method Name: space_step


Project Name: lcswillems/torch-rl
Commit Name: 6ee019df2ef9534773953808b9b2116f3e6521dc
Time: 2018-05-31
Author: lcswillems@gmail.com
File Name: torch_rl/torch_rl/utils/multienv.py
Class Name: MultiEnv
Method Name: step


Project Name: lcswillems/torch-rl
Commit Name: c60fbc4da1b0b1732d8a4e15f6a60c48251150b4
Time: 2018-06-11
Author: lcswillems@gmail.com
File Name: torch_rl/torch_rl/utils/penv.py
Class Name: ParallelEnv
Method Name: step