An open API service indexing awesome lists of open source software.

https://github.com/instance01/continuous-lunarlander-cpp

C++ implementation of the continuous LunarLander environment.
https://github.com/instance01/continuous-lunarlander-cpp

gym gym-environment gym-environments lunar-lander openai-gym reinforcement-learning

Last synced: 3 months ago
JSON representation

C++ implementation of the continuous LunarLander environment.

Awesome Lists containing this project

README

        

This is a C++ reimplementation of OpenAI's gym environment LunarLander (the continuous version).
It works but definitely needs more work.

Since it supports model-based approaches such as AlphaZero (which requires the environment to be clonable for the MCTS), it unfortunately requires a box2d fork that supports getting and setting the sleep time of bodies.
The fork is linked in this repository.

## Installation

To use it, copy both `lunar_lander.cpp` and `lunar_lander.hpp` to your project and add the box2d fork as a dependency.
An example for cmake can be found [here](https://github.com/instance01/GRAB0/blob/master/src/CMakeLists.txt).

After you're done, do `cmake` and `cmake --build .`.

## Usage

The API follows the standard OpenAI gym API (except for reset(), which requires a generator).
As for the generator, I'm open for PRs that move it to the constructor.

```
std::vector reset(std::mt19937 &generator);
std::tuple, double, bool> step(std::vector &action);
```