OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-rocca commits / 44dcdc0

Update observation after collecting diamonds
44dcdc0a5de4ffefd1fbaad63c503dfb2062c4ca
by Hedra <tanksh24@gmail.com> · 2022-02-10T17:26:42.000Z

Changed files (1) +6 -1

rocca/envs/malmo_demo/flatworld_env.py +6 -1
……@@ -295,17 +295,22 @@ def go_to_house(agent):
295295# reward = 1
296296def go_to_diamonds(agent):
297297 agent.sendCommand("chat go_to_diamonds")
298 observation = {}
298299 curr_x, curr_y, curr_z = get_curr_loc(agent)
299300 turn_to(agent, curr_x, curr_y, curr_z, diamond_x, diamond_y, diamond_z)
300301 time.sleep(0.2)
301302 agent.sendCommand("move 1")
302303 action_complete = stop_condition(agent, "diamond_block")
303304 if action_complete:
305 agent.sendCommand("attack 1")
306 time.sleep(0.2)
307 agent.sendCommand("attack 0")
308 time.sleep(0.2)
304309 reward = 1
305310 relocate_agent(agent)
311 observation["outside"] = ["self", "house"]
306312 else:
307313 reward = 0
308 observation = {}
309314 if not inside_house(curr_x, curr_z):
310315 observation["outside"] = ["self", "house"]
311316 if hold_key: