Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
jwaa committed Jan 12, 2021
2 parents 3b2a014 + cc4e4f2 commit bfa924d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ log_data/
# Ignore generated documentation files
docs/build
docs/source/sections/_generated_autodoc

*.whl

*.gz
2 changes: 1 addition & 1 deletion matrx/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
__url__ = 'https://matrx-software.com'
__doc_url__ = 'http://docs.matrx-software.com/en/latest/'
__source_url__ = 'https://github.com/matrx-software/matrx'
__version__ = '2.0.3'
__version__ = '2.0.4'
__author__ = 'MATRX Team at TNO.nl'
__author_email__ = 'info@matrx.com'
__license__ = 'MIT License'
Expand Down
7 changes: 4 additions & 3 deletions matrx/actions/object_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ def is_possible(self, grid_world, agent_id, **kwargs):
if 'object_id' in kwargs:
obj_id = kwargs['object_id']
elif len(reg_ag.is_carrying) > 0:
obj_id = reg_ag.is_carrying[-1]
obj_id = reg_ag.is_carrying[-1].obj_id
else:
return DropObjectResult(DropObjectResult.RESULT_NO_OBJECT, False)

Expand Down Expand Up @@ -543,7 +543,8 @@ def mutate(self, grid_world, agent_id, **kwargs):

# If no object id is given, the last item is dropped
if 'object_id' in kwargs:
env_obj = kwargs['object_id']
obj_id = kwargs['object_id']
env_obj = [obj for obj in reg_ag.is_carrying if obj.obj_id == obj_id][0]
elif len(reg_ag.is_carrying) > 0:
env_obj = reg_ag.is_carrying[-1]
else:
Expand Down Expand Up @@ -877,7 +878,7 @@ def _possible_drop(grid_world, agent_id, obj_id, drop_range):
return DropObjectResult(DropObjectResult.RESULT_NONE_GIVEN, False)

# No object with that name
if not (obj_id in reg_ag.is_carrying):
if isinstance(obj_id, str) and not any([obj_id == obj.obj_id for obj in reg_ag.is_carrying]):
return DropObjectResult(DropObjectResult.RESULT_NO_OBJECT, False)

if len(loc_obj_ids) == 1:
Expand Down

0 comments on commit bfa924d

Please sign in to comment.