{-# LANGUAGE FlexibleInstances #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Environments.Gym.ClassicControl.CartPoleV0
( Action(..)
, I.Runner
, StateCP(..)
, Environment
, EnvironmentT
, Environments.Gym.ClassicControl.CartPoleV0.runEnvironment
, Environments.Gym.ClassicControl.CartPoleV0.runEnvironmentT
, Environments.Gym.ClassicControl.CartPoleV0.runDefaultEnvironment
, Environments.Gym.ClassicControl.CartPoleV0.runDefaultEnvironmentT
) where
import Reinforce.Prelude
import Data.CartPole
import Control.MonadEnv (MonadEnv(..), Reward)
import Environments.Gym.Internal (GymEnvironmentT)
import qualified Environments.Gym.Internal as I
import OpenAI.Gym (GymEnv(CartPoleV0))
type EnvironmentT t = GymEnvironmentT StateCP Action t
type Environment = EnvironmentT IO
runEnvironmentT :: MonadIO t => Manager -> BaseUrl -> I.RunnerT StateCP Action t x
runEnvironmentT = I.runEnvironmentT CartPoleV0
runEnvironment :: Manager -> BaseUrl -> I.RunnerT StateCP Action IO x
runEnvironment = I.runEnvironmentT CartPoleV0
runDefaultEnvironmentT :: MonadIO t => I.RunnerT StateCP Action t x
runDefaultEnvironmentT = I.runDefaultEnvironmentT CartPoleV0
runDefaultEnvironment :: I.RunnerT StateCP Action IO x
runDefaultEnvironment = I.runDefaultEnvironmentT CartPoleV0
instance (MonadIO t, MonadThrow t) => MonadEnv (EnvironmentT t) StateCP Action Reward where
reset = I._reset
step = I._step