1.2.13 • Published 2 days ago

gymrl v1.2.13

Weekly downloads
-
License
MIT
Repository
github
Last release
2 days ago

GymRL

npm Author

GymRL is a package that provides various environments for reinforcement learning.

Prerequisites

Before you begin, ensure you have met the following requirements:

Installation

Install GymRL using npm:

$ npm install gymrl --save

Environments

GymRL currently supports the following environments:

  1. TwoThousandfortyeight
  2. Fourinarow
  3. Frozenlake
  4. Snake
  5. TicTacToe

You can import an environment as follows:

const {Snake} = require("gymrl")
const {TwoThousandfortyeight} = require("gymrl")

Usage

Here is an example of how to use the Snake environment:

const {Snake} = require("gymrl")

let match = new Snake(10); // This creates a map of 10x10
let score = 0;
let done = false;

match.render();

let status = match.get_obs();

while(!done){
    let randomAction = Snake.sampleAction();
    let Stepinfo = match.step(randomAction);
    status = Stepinfo[0];
    let reward = Stepinfo[1];
    done = Stepinfo[2];
    let info = Stepinfo[3];
    score += reward;
    match.render();
}

Methods

The following methods are available in all environments:

  • render(): Creates a string representation of the environment and displays it in the console.
  • sampleAction(): Returns a random action from the environment.
  • get_obs(): Returns the current observations of the environment.
  • get_info(): Returns additional information about the observations of the environment.
  • reset(): Resets the environment.
  • step(action): Performs one step in the environment using the specified action and returns an array with four entries: newStatus, Reward, Done, Info.

More Info About the Environments

You can see more info about the enviroments in our wiki

Contributing to GymRL

If you want to contribute to GymRL, whether by adding a new environment or fixing bugs, please check out the source code and submit a pull request or issue.

1.2.13

2 days ago

1.2.12

2 days ago

1.2.11

3 days ago

1.2.9

4 days ago

1.2.10

3 days ago

1.2.8

5 days ago

1.2.7

5 days ago

1.2.6

5 days ago

1.2.5

6 days ago

1.2.4

6 days ago

1.2.3

6 days ago

1.2.2

9 days ago

1.2.1

9 days ago

1.2.0

10 days ago

1.1.7

11 days ago

1.1.6

11 days ago

1.1.5

11 days ago

1.1.4

7 months ago

1.1.3

7 months ago

1.1.2

7 months ago

1.1.1

7 months ago

1.1.0

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago