f2408b719c991b98ba5dc77db81dc184805b33df,rllib/env/pettingzoo_env.py,PettingZooEnv,step,#PettingZooEnv#Any#,141
Before Change
env_done = False
// iterate over self.agents
for agent in self.agents:
// Execute only for agents that have not been done in previous steps
if agent in action_dict.keys():
if not env_done:
assert agent == self.aec_env.agent_selection, \
f"environment has a nontrivial ordering, and " \
"cannot be used with the POMGameEnv wrapper\"" \
"nCurrent agent: {self.aec_env.agent_selection}" \
"\nExpected agent: {agent}"
// Execute agent action in environment
self.obs[agent] = self.aec_env.step(
action_dict[agent], observe=True)
if all(self.aec_env.dones.values()):
env_done = True
self.dones["__all__"] = True
else:
self.obs[agent] = self.aec_env.observe(agent)
// Get reward
self.rewards[agent] = self.aec_env.rewards[agent]
// Update done status
self.dones[agent] = self.aec_env.dones[agent]
// For agents with done = True, remove from dones, rewards and
// observations.
else:
del self.dones[agent]
del self.rewards[agent]
del self.obs[agent]
del self.infos[agent]
// update self.agents
self.agents = list(action_dict.keys())
// Update infos stepwise
for agent in self.agents:
After Change
"__all__" (required) is used to indicate env termination.
infos (dict): Optional info values for each agent id.
stepped_agents = set()
while self.aec_env.agent_selection not in stepped_agents:
agent = self.aec_env.agent_selection
assert agent in action_dict, \
"Live environment agent is not in actions dictionary"
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: ray-project/ray
Commit Name: f2408b719c991b98ba5dc77db81dc184805b33df
Time: 2020-09-17
Author: weepingwillowben@gmail.com
File Name: rllib/env/pettingzoo_env.py
Class Name: PettingZooEnv
Method Name: step
Project Name: AlexEMG/DeepLabCut
Commit Name: 0ef2bfb1adda578c45e9c56412f86c02b950c0a3
Time: 2020-06-18
Author: saveliy.m.yusufov@gmail.com
File Name: deeplabcut/utils/make_labeled_video.py
Class Name:
Method Name: CreateVideoSlow
Project Name: AlexEMG/DeepLabCut
Commit Name: ef59c0f5b64e5a3e76790855795a6393c5858963
Time: 2020-05-27
Author: 30733203+jeylau@users.noreply.github.com
File Name: deeplabcut/generate_training_dataset/multiple_individuals_labeling_toolbox.py
Class Name: MainFrame
Method Name: browseDir