Skip to content

A simple stochastic OpenAI environment for training RL agents

Notifications You must be signed in to change notification settings

MartinThoma/banana-gym

Folders and files

NameName
Last commit message
Last commit date
Aug 18, 2020
Jun 2, 2021
Jul 4, 2020
Jul 22, 2018
Jul 22, 2018
Mar 17, 2020
Apr 11, 2021
Apr 11, 2021
Nov 11, 2017
Feb 5, 2021
Feb 5, 2021
Feb 5, 2021

Repository files navigation

This repository contains a PIP package which is an OpenAI environment for simulating an enironment in which bananas get sold.

Installation

Install the OpenAI gym.

Then install this package via

pip install -e .

Usage

import gym
import gym_banana

env = gym.make('Banana-v0')

See https://github.com/matthiasplappert/keras-rl/tree/master/examples for some examples.

The Environment

Imagine you are selling bananas. One at a time. And the bananas get bad pretty quickly. Let's say in 3 days. The probability that I will sell the banana is given by

p ( x ) = ( 1 + e ) / ( 1. + e ( x + 1 ) )

where x-1 is my profit. This x-1 is my reward. If I don't sell the banana, the agent gets a reward of -1 (the price of the banana).