Skip to content

Commit

Permalink
Added test case to test creation and running of each task. Added blog…
Browse files Browse the repository at this point in the history
… in README.md, ai2thor version, continuous movement
  • Loading branch information
beduffy committed Mar 27, 2019
1 parent 8f4e3b7 commit 2fe8626
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,13 @@ We included our own wrapper for the environment as well to support the modificat
within an openAI gym interface, so that new and more complex tasks can be developed efficiently to
train and test the agent.

We will release a blog soon which will go into more detail about this repo and how to use all of the features of our wrapper.
We have begun a long-running blog series which will go into more detail about this repo and how to use all of the features of our wrapper.

- [From Cups to Consciousness (Part 1): How are cups related to intelligence?](https://towardsdatascience.com/from-cups-to-consciousness-part-1-how-are-cups-related-to-intelligence-8b7c701fa197)

Currently using ai2thor version 0.0.44.
More detailed information on ai2thor environment can be found on their
[tutorial](http://ai2thor.allenai.org/tutorials/installation).
[website](http://ai2thor.allenai.org/tutorials/installation).


<div align="center">
Expand Down Expand Up @@ -140,7 +144,8 @@ class MoveAheadTask(BaseTask):

We encourage you to explore the scripts on the `examples` folder to guide you on the wrapper
functionalities and explore how to create more customized versions of ai2thor environments and
tasks.
tasks. It is possible for the agent to do continuous rotation with 10 degrees by setting
`continuous_movement: True` in the config as well, see task_on_ground_variation.py in examples.

Here is the desired result of an example task in which the goal of the agent is to place a cup in the
sink.
Expand Down
26 changes: 26 additions & 0 deletions tests/test_ai2thor_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,32 @@ def test_environments_runs(self):
self.assertTrue(len(all_step_times) == num_steps)
env.close()

def test_all_task_init(self):
"""
Test that the creation of all tasks still works by taking a few random steps after
resetting environment
"""
param_list = [
{
'pickup_objects': [
'Mug',
'Apple'
],
'task': {
'task_name': 'PickUpTask',
'target_objects': {'Mug': 1, 'Apple': 5}
}
}
]

for params in param_list:
env = AI2ThorEnv(config_dict=params)
state = env.reset()
for i in range(5):
action = env.action_space.sample()
state, reward, done, _ = env.step(action)
env.close()

def test_cup_task_and_interaction_actions(self):
"""
Check if picking up and putting down cup works and agent receives reward of 2 for doing it
Expand Down

0 comments on commit 2fe8626

Please sign in to comment.