Simulator for Reinforcement Learning
Project description
Welcome to simple-playgrounds
Simple-Playgrounds (SPG) is an easy-to-use, fast and flexible simulation environment for research in Deep Reinforcement Learning and Artificial Intelligence. This simulator proposes a huge diversity of environments for embodied agents learning through physical interactions. It bridges the gap between simple and efficient grid environments, and complex and challenging 3D environments.
The playgrounds are 2D environments where agents can move around and interact with scene elements. The game engine, based on Pymunk and Pygame, deals with simple physics, such as collision and friction. Agents can act through continuous movements and discrete interactive actions. They perceive the scene with realistic first-person view sensors, top-dow vew sensors, and semantic sensors.
This simulator is easy to handle, and very flexible. It allows very fast design of AI experiments and runs experiments very quickly.
We hope that you can make use of this simulator for your research. If you publish your work based on this simulator, please use the following reference:
@misc{Simple-Playgrounds,
author = {Garcia Ortiz, Michael and Jankovics, Vince and Caselles-Dupre, Hugo and Annabi, Louis},
title = {Simple-Playgrounds},
year = {2021},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/mgarciaortiz/simple-playgrounds}},
}
Installation
Before installing Simplel-Playgrounds, you might need to install libsdl1.2-dev and Pygame manually.
Once these dependencies are installed, you can install simple-playgrounds using pip. A pip package is available and regularly updated:
pip3 install simple-playgrounds
Tutorials
We provide a series of small tutorials to illustrate the capabilities of Simple-Playgrounds. We suggest running them locally to benefit from the keyboard control of the agents.
01 - Welcome to simple-playgrounds
02 - Learn to build playgrounds
03 - Add elements to your playground
04 - Modify the appearance of elements
We advise to run the notebook locally, so that more advanced display options are available.
Structure of the simulator
Agents
Agents are composed of different body parts attached to a Base. Different bases are available, each of them with different actuators.
The actuators controlling the base and body parts are managed by a controller. The controller can be:
- Random: each actuator is set randomly at every timestep.
- Keyboard: the agent is controlled by pressing keys on the Keyboard.
- External: used to set the actions from outside of the simulators (used in RL)
Agents perceive their surroundings through a large collection of first-person view sensors:
- RGB Camera / Grey Level Camera
- Lidar
- Touch Sensor
- Top-down view
- Semantic Sensors (Rays or Cones)
Any number of sensors can be added to the agent. The sensors are parameterizable in terms of field of view, range, and resolution.
Noise
Sensors as well as Actuators can be noisy.
Playground
Agents act and perceive in a Playground. A playground is composed of scene elements, which can be fixed or movable. An agent can grasp, eat, activate or absorb certain scene elements. Depending on their nature, particular scene elements will provide reward to the agent interacting with them.
Coordinate System
A playground is described using a Cartesian coordinate system. Each element has a position (x,y, &theta), with x along the horizontal axis, y along the vertical axis, and theta the orientation, aligned on the horizontal axis.
A playground has a size [width, length], with the width along x-axis, and length along y-axis
When applicable, the length of a scene element follows the element's x-axis.
A playground is a collection of scene elements, and therefore can be very easily scripted.
Game Engine
Agents enter a Playground, and start acting and perceiving within this environment. The perception/action loop is managed by a Game Engine.
Application of SPG in different Research fields
The classical use of SPG is Reinforcement Learning. You can build simple to very complex environments that look into classical challenges of RL. The diversity and speed of SPG allows to experiment on:
- Continual learning and Transfer Learning: Move the agent from Playground to Playground.
- Exploration: Get the key to open the door to get the other key to open the chess that will give you the reward.
SPG allows you to address the problematics of other fields related to RL:
- MARL: why not put several agents in the environments?
- Curriculum learning: Send agents to Playgrounds of increasing difficulty
- Procedural Generation: Automatically create just the right Playground.
- Representation learning and commonsense knowledge.
Because of its flexibility, and the numerous sensors and actuators, SPG allows to test for:
- generalization of your approach
- resistance to noise, and variations of sensor types
- reproducibility
Acknowledgements
The first version of the simulator was called Flatland, and was designed by Hugo Caselles-Dupre, Louis Annabi, Oksana Hagen and Michael Garcia Ortiz.
The new version was developed by Vince Jankovics, Hugo Caselles-Dupre, Louis Annabi and Michael Garcia Ortiz.
We would like to thank Clement Moulin-Frier and Younes Rabii for their helpful suggestions and their contributions to the new version of the simulator.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file simple_playgrounds-0.9.31.tar.gz
.
File metadata
- Download URL: simple_playgrounds-0.9.31.tar.gz
- Upload date:
- Size: 64.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 406e59dfa2d4e99d45b953172b2767a70039a2ede24b9660519efed1047a3823 |
|
MD5 | 5dc53ce94096f6b0c3bdc4cb359c8067 |
|
BLAKE2b-256 | 1f2d4c802ed131423d1a1d4c302bdbe75e9c7253725af9e5311899a600c400c1 |
File details
Details for the file simple_playgrounds-0.9.31-py3-none-any.whl
.
File metadata
- Download URL: simple_playgrounds-0.9.31-py3-none-any.whl
- Upload date:
- Size: 84.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8509b3752e5c69ef894e858ea787f4f3dae1cb2de2dd3556d94a57cc31f69b4d |
|
MD5 | 972614ef522d00b261045ae5a0765f97 |
|
BLAKE2b-256 | 21737ef821a8e85ba6f8f37664fa8c49dc0581dd2d5fb76a55524a3a8263c426 |