Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hackage release 0.1.0.1 #57

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ binding-rust/target
# Haskell binding
binding-hs/.stack-work/*
binding-hs/*.tags
binding-hs/.cabal-sandbox
binding-hs/cabal.sandbox.config
binding-hs/dist

# Clojure binding
.nrepl-port
Expand Down
166 changes: 166 additions & 0 deletions binding-hs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
# Version 0.1.0.2

[tag v0.1.0.2](https://github.com/stites/gym-http-api/releases/tag/v0.1.0.2)

- Expose all environments listed at https://gym.openai.com/envs/ as of 07/17/2018. Current environments supported includes:
+ Classic Control Environments:
+ CartPoleV0
+ CartPoleV1
+ AcrobotV1
+ MountainCarV0
+ MountainCarContinuousV0
+ PendulumV0
+ Toy Text Environments
+ BlackjackV0
+ FrozenLakeV0
+ FrozenLake8x8V0
+ GuessingGameV0
+ HotterColderV0
+ NChainV0
+ RouletteV0
+ TaxiV2
+ Box2D Environments:
+ BipedalWalkerV2
+ BipedalWalkerHardcoreV2
+ CarRacingV0
+ LunarLanderV2
+ LunarLanderContinuousV2
+ Algorithm Environments:
+ CopyV0
+ DuplicatedInputV0
+ RepeatCopyV0
+ ReverseV0
+ ReversedAdditionV0
+ ReversedAddition3V0
+ Atari Environments:
+ AirRaidRamV0
+ AirRaidV0
+ AlienRamV0
+ AlienV0
+ AmidarRamV0
+ AmidarV0
+ AssaultRamV0
+ AssaultV0
+ AsterixRamV0
+ AsterixV0
+ AsteroidsRamV0
+ AsteroidsV0
+ AtlantisRamV0
+ AtlantisV0
+ BankHeistRamV0
+ BankHeistV0
+ BattleZoneRamV0
+ BattleZoneV0
+ BeamRiderRamV0
+ BeamRiderV0
+ BerzerkRamV0
+ BerzerkV0
+ BowlingRamV0
+ BowlingV0
+ BoxingRamV0
+ BoxingV0
+ BreakoutRamV0
+ BreakoutV0
+ CarnivalRamV0
+ CarnivalV0
+ CentipedeRamV0
+ CentipedeV0
+ ChopperCommandRamV0
+ ChopperCommandV0
+ CrazyClimberRamV0
+ CrazyClimberV0
+ DemonAttackRamV0
+ DemonAttackV0
+ DoubleDunkRamV0
+ DoubleDunkV0
+ ElevatorActionRamV0
+ ElevatorActionV0
+ EnduroRamV0
+ EnduroV0
+ FishingDerbyRamV0
+ FishingDerbyV0
+ FreewayRamV0
+ FreewayV0
+ FrostbiteRamV0
+ FrostbiteV0
+ GopherRamV0
+ GopherV0
+ GravitarRamV0
+ GravitarV0
+ IceHockeyRamV0
+ IceHockeyV0
+ JamesbondRamV0
+ JamesbondV0
+ JourneyEscapeRamV0
+ JourneyEscapeV0
+ KangarooRamV0
+ KangarooV0
+ KrullRamV0
+ KrullV0
+ KungFuMasterRamV0
+ KungFuMasterV0
+ MontezumaRevengeRamV0
+ MontezumaRevengeV0
+ MsPacmanRamV0
+ MsPacmanV0
+ NameThisGameRamV0
+ NameThisGameV0
+ PhoenixRamV0
+ PhoenixV0
+ PitfallRamV0
+ PitfallV0
+ PongRamV0
+ PongV0
+ PooyanRamV0
+ PooyanV0
+ PrivateEyeRamV0
+ PrivateEyeV0
+ QbertRamV0
+ QbertV0
+ RiverraidRamV0
+ RiverraidV0
+ RoadRunnerRamV0
+ RoadRunnerV0
+ RobotankRamV0
+ RobotankV0
+ SeaquestRamV0
+ SeaquestV0
+ SkiingRamV0
+ SkiingV0
+ SolarisRamV0
+ SolarisV0
+ SpaceInvadersRamV0
+ SpaceInvadersV0
+ StarGunnerRamV0
+ StarGunnerV0
+ TennisRamV0
+ TennisV0
+ TimePilotRamV0
+ TimePilotV0
+ TutankhamRamV0
+ TutankhamV0
+ UpNDownRamV0
+ UpNDownV0
+ VentureRamV0
+ VentureV0
+ VideoPinballRamV0
+ VideoPinballV0
+ WizardOfWorRamV0
+ WizardOfWorV0
+ YarsRevengeRamV0
+ YarsRevengeV0
+ ZaxxonRamV0
+ ZaxxonV0

# Version 0.1.0.1

[tag v0.1.0.1](https://github.com/stites/gym-http-api/releases/tag/v0.1.0.1)

- Bump compatability with lts-11

# Version 0.1.0.0

[tag v0.1.0.0](https://github.com/stites/gym-http-api/releases/tag/v0.1.0.0)

- Initial release. API contains basic environments and Aeson-based functions.

1 change: 1 addition & 0 deletions binding-hs/LICENSE
25 changes: 9 additions & 16 deletions binding-hs/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
# Haskell Binding for the OpenAI gym open-source library

## Building
To run the example agent:

```
stack setup
stack build
stack exec example
stack build && stack exec example
```

## Checklist
- [x] Implemented query functions
- [x] Added an example agent
- [ ] Added environment variable functionality to obtain the API key
- [ ] Optimization (lagging can be detected while running the example agent)
- [ ] Test suite
This library provides a servant-based REST client to the gym open-source library.
[openai/gym-http-api][openai] itself provides a [python-based REST server][flask]
to the gym open-source library, allowing development in languages other than python.

[openai]:https://github.com/openai/gym-http-api
[flask]:https://github.com/openai/gym-http-api/blob/master/gym_http_server.py

## Required HTTP Libraries
- aeson
- http-client
- servant
- servant-client
- servant-lucid
6 changes: 6 additions & 0 deletions binding-hs/TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## Checklist
- [ ] Add environment variable functionality to obtain the API key
- [ ] Optimization (lagging can be detected while running the example agent)
- [ ] Test suite


19 changes: 12 additions & 7 deletions binding-hs/examples/Agent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,27 @@
-- Example of how to build an agent using OpenAI.Gym.Client
-------------------------------------------------------------------------------
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE CPP #-}
module Main where

import Prelude
import Control.Monad (replicateM_, when)
import Control.Monad.Catch
import Control.Exception.Base
import Control.Exception.Base
import Control.Monad (replicateM_, when)
import Control.Monad.Catch
import Prelude

import OpenAI.Gym
import Servant.Client
import Network.HTTP.Client
import Network.HTTP.Client
import OpenAI.Gym
import Servant.Client


main :: IO ()
main = do
manager <- newManager defaultManagerSettings
#if MIN_VERSION_servant_client(0,13,0)
out <- runClientM example (ClientEnv manager url Nothing)
#else
out <- runClientM example (ClientEnv manager url)
#endif
case out of
Left err -> print err
Right ok -> print ok
Expand Down
51 changes: 28 additions & 23 deletions binding-hs/gym-http-api.cabal
Original file line number Diff line number Diff line change
@@ -1,50 +1,53 @@
-- This file has been generated from package.yaml by hpack version 0.15.0.
-- This file has been generated from package.yaml by hpack version 0.21.2.
--
-- see: https://github.com/sol/hpack
--
-- hash: 085a2053bc4ebb1d1451b833911deb047b05b2a99658d37c37af73e0bda7d26f

name: gym-http-api
version: 0.1.0.0
description: Haskell binding for the OpenAi gym API
category: Web
homepage: https://github.com/openai/gym-http-api#readme
bug-reports: https://github.com/openai/gym-http-api/issues
version: 0.1.0.1
synopsis: REST client to the gym-http-api project
description: This library provides a REST client to the gym open-source library. gym-http-api itself provides a <https://github.com/openai/gym-http-api/blob/master/gym_http_server.py python-based REST> server to the gym open-source library, allowing development in languages other than python.
.
Note that the <https://github.com/openai/gym-http-api/ openai/gym-http-api> is a monorepo of all language-clients. This hackage library tracks <https://github.com/stites/gym-http-api/ stites/gym-http-api> which is the actively-maintained haskell fork.
category: Web, Learning Environments
homepage: https://github.com/stites/gym-http-api#readme
bug-reports: https://github.com/stites/gym-http-api/issues
author: Daniel Lucsanszky, Sam Stites
maintainer: dl3913@ic.ac.uk, sam@stites.io
license: MIT
license-file: ../LICENSE
license-file: LICENSE
build-type: Simple
cabal-version: >= 1.10

extra-source-files:
CHANGELOG.md
README.md
TODO.md

source-repository head
type: git
location: https://github.com/openai/gym-http-api
location: https://github.com/stites/gym-http-api
subdir: binding-hs

library
hs-source-dirs:
src
default-extensions: OverloadedStrings
build-depends:
exceptions
, http-client
, servant-client
aeson >=1.0
, base >=4.7 && <5
, aeson
, monad-loops
, unordered-containers
, servant
, servant-lucid
, text
, transformers
, servant >=0.9
, servant-client >=0.9
, servant-lucid >=0.7
, text >=1.2
, unordered-containers >=0.2
exposed-modules:
OpenAI.Gym
OpenAI.Gym.API
OpenAI.Gym.Data
other-modules:
OpenAI.Gym.Prelude
Paths_gym_http_api
default-language: Haskell2010

executable example
Expand All @@ -53,9 +56,11 @@ executable example
examples
default-extensions: OverloadedStrings
build-depends:
exceptions
, http-client
, servant-client
, base >=4.7 && <5
base >=4.7 && <5
, exceptions >=0.8
, gym-http-api
, http-client >=0.5
, servant-client >=0.9
other-modules:
Paths_gym_http_api
default-language: Haskell2010
Loading