8c17debc9dc6552da8c317c0c852b55f03c80c61,slm_lab/env/__init__.py,EnvSpace,step,#EnvSpace#Any#,258
Before Change
def step(self, action_space):
reward_proj = []
state_proj = []
done_proj = []
for e, env in enumerate(self.envs):
action = action_space.get(e=e)
reward, state, done = env.step(action)
reward_proj.append(reward)
state_proj.append(state)
done_proj.append(done)
reward_space = self.aeb_space.add("reward", reward_proj)
state_space = self.aeb_space.add("state", state_proj)
done_space = self.aeb_space.add("done", done_proj)
return reward_space, state_space, done_space
After Change
def step(self, action_space):
reward_v = self.aeb_space.data_spaces["reward"].init_data_v()
state_v = self.aeb_space.data_spaces["state"].init_data_v()
done_v = self.aeb_space.data_spaces["done"].init_data_v()
for env in self.envs:
e = env.e
action_e = action_space.get(e=e)
reward_e, state_e, done_e = env.step(action_e)
reward_v[e, 0:len(reward_e)] = reward_e
state_v[e, 0:len(state_e)] = state_e
done_v[e, 0:len(done_e)] = done_e
reward_space = self.aeb_space.add("reward", reward_v)
state_space = self.aeb_space.add("state", state_v)
done_space = self.aeb_space.add("done", done_v)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 11
Instances
Project Name: kengz/SLM-Lab
Commit Name: 8c17debc9dc6552da8c317c0c852b55f03c80c61
Time: 2017-12-24
Author: kengzwl@gmail.com
File Name: slm_lab/env/__init__.py
Class Name: EnvSpace
Method Name: step
Project Name: kengz/SLM-Lab
Commit Name: 8c17debc9dc6552da8c317c0c852b55f03c80c61
Time: 2017-12-24
Author: kengzwl@gmail.com
File Name: slm_lab/agent/__init__.py
Class Name: AgentSpace
Method Name: act
Project Name: kengz/SLM-Lab
Commit Name: 8c17debc9dc6552da8c317c0c852b55f03c80c61
Time: 2017-12-24
Author: kengzwl@gmail.com
File Name: slm_lab/env/__init__.py
Class Name: EnvSpace
Method Name: reset