Skip to content

fixed grabbing behaviour in agent #1148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 18, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
"""

# TODO
# Implement grabbing correctly.
# When an object is grabbed, does it still have a location?
# What if it is released?
# What if the grabbed or the grabber is deleted?
# What if the grabber moves?
# Speed control in GUI does not have any effect -- fix it.

from utils import distance_squared, turn_heading
Expand Down Expand Up @@ -966,16 +961,7 @@ def execute_action(self, agent, action):
return

agent.bump = False
if action == 'TurnRight':
super().execute_action(agent,action)
agent.performance -= 1
elif action == 'TurnLeft':
super().execute_action(agent,action)
agent.performance -= 1
elif action == 'Forward':
super().execute_action(agent,action)
agent.performance -= 1
elif action == 'Grab':
if action in ['TurnRight', 'TurnLeft', 'Forward','Grab']:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A space is needed after the last comma.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

super().execute_action(agent,action)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need a space after the comma, to comply with the overall project style.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

agent.performance -= 1
elif action == 'Climb':
Expand Down