Skip to content
OpenLock Environment for OpenAI Gym
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


OpenLock is an OpenAI Gym environment, designed for transfer learning. The environment is governed by compositional structure that requires reasoning about an abstract latent state. OpenLock is a virtual "escape room" where agents are required to interact with levers in order to open the door. Agents are required to find all solutions within a room. After completing a single room, agents are moved to a new room with the same underlying abstract structure, but the positions of each lever has been changed.

This experimental setup is designed to test whether or not agents are capable of forming an abstract representation of the task.

The gif below summarizes the environment's execution and how lever positions change between rooms:

OpenLock environment executions

The environment supports a number of scenarios, each of which encode a specific locking mechanism that governs the environment:

causal structures

For additional details on the environment, please see the project page for our CogSci 2018 paper:


To install:

  1. Use Python 3.5+

  2. Install the following system-level packages:

sudo apt-get install python3-tk graphviz graphviz-dev
  1. Create a virtual envrionment for OpenLock. Then run:
pip3 install -r requirements.txt
  1. Finally, install pybox2d from source (

  2. You may run into problems with modules. If you run into "ImportError: No module named 'future'", run pip3 install future.


If you use this environment in your work, please use the following citation:

  title={Human Causal Transfer: Challenges for Deep Reinforcement Learning},
  author={Edmonds, Mark and Kubricht, James, Feng and Summers, Colin and Zhu, Yixin and Rothrock, Brandon and Zhu, Song-Chun and Lu, Hongjing},
  booktitle={40th Annual Meeting of the Cognitive Science Society},
You can’t perform that action at this time.