diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5d1ea557 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +src/gymfcpp/gymfcpp_config.h +src/gymfcpp/gymfcpp_version.h diff --git a/src/gymfcpp/cart_pole.cpp b/src/gymfcpp/cart_pole.cpp index f07bfb4e..a106594a 100644 --- a/src/gymfcpp/cart_pole.cpp +++ b/src/gymfcpp/cart_pole.cpp @@ -109,7 +109,6 @@ CartPole::make(){ std::string cpp_str = "import gym \n"; cpp_str += "import numpy as np \n"; - cpp_str += "import torch \n"; cpp_str += CartPole::py_env_name + " = gym.make('" + CartPole::name +"-" + data_.v + "').unwrapped\n"; // create an environment diff --git a/src/gymfcpp/cart_pole.h b/src/gymfcpp/cart_pole.h index 3b40e589..d0e96b2c 100644 --- a/src/gymfcpp/cart_pole.h +++ b/src/gymfcpp/cart_pole.h @@ -26,17 +26,17 @@ class CartPole: private boost::noncopyable public: /// - /// \brief action_t + /// \brief action_t. The type of the action /// typedef uint_t action_t; /// - /// \brief state_t + /// \brief state_t. The type of the state /// typedef std::vector state_t; /// - /// \brief time_step_t + /// \brief time_step_t. The type of the time step /// typedef TimeStep time_step_t; @@ -46,12 +46,12 @@ class CartPole: private boost::noncopyable static std::string name; /// - /// \brief py_env_name + /// \brief py_env_name. The name of the environment in Python REPL /// static std::string py_env_name; /// - /// \brief py_step_result_name + /// \brief py_step_result_name. The name of the result when stepping in the Python REPL /// static std::string py_step_result_name; @@ -61,7 +61,7 @@ class CartPole: private boost::noncopyable static std::string py_reset_result_name; /// - /// \brief The class Screen + /// \brief The class Screen. Wrapper to the screen captured when calling render /// class Screen; @@ -71,14 +71,12 @@ class CartPole: private boost::noncopyable CartPole(const std::string& version, obj_t gym_namespace, bool do_create=true); /// - /// \brief make - /// \param is_slipery + /// \brief make. Build the environment /// void make(); /// - /// \brief n_actions - /// \return + /// \brief n_actions. Returns the number of actions /// uint_t n_actions()const; @@ -149,22 +147,22 @@ class CartPole::Screen Screen(obj_t screen, std::array&& shp); /// - /// \breif shape + /// \brief shape. The shape of screen. /// std::array shape()const noexcept{return shape_;}; /// - /// \brief + /// \brief get_as_vector. Returns the screen as floats /// const std::vector>>& get_as_vector()const; /// - /// + /// \brief is_valid. Returns true if the computed screen is valid /// bool is_valid()const noexcept{return is_valid_screen_;} /// - /// + /// \brief invalidate. Invalidate the screen. /// void invalidate() noexcept; diff --git a/src/gymfcpp/time_step.h b/src/gymfcpp/time_step.h index aae34654..56f58d33 100644 --- a/src/gymfcpp/time_step.h +++ b/src/gymfcpp/time_step.h @@ -33,15 +33,15 @@ class TimeStep TimeStep(); /// - /// + /// \brief TimeStep. Constructor /// TimeStep(TimeStepTp type, real_t reward, state_t obs); /// - /// + /// \brief TimeStep. Constructor /// TimeStep(TimeStepTp type, real_t reward, state_t obs, std::unordered_map&& extra); - + /// /// \brief first /// \return @@ -70,7 +70,7 @@ class TimeStep /// \brief observation /// \return /// - uint_t observation()const{return obs_;} + state_t observation()const{return obs_;} /// /// \brief reward