diff --git a/README.md b/README.md index 002da13..b152151 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Use the environment for training a reinforcement learning agent: from stable_baselines3 import PPO from fastfiz_env import DefaultReward, make -env = make("SimpleFastFiz-v0", reward_function=DefaultReward, num_balls=2) +env = make("FastFiz-v0", reward_function=DefaultReward, num_balls=2) model = PPO("MlpPolicy", env) diff --git a/src/fastfiz_env/__init__.py b/src/fastfiz_env/__init__.py index 5aef3cb..3195869 100644 --- a/src/fastfiz_env/__init__.py +++ b/src/fastfiz_env/__init__.py @@ -2,7 +2,7 @@ Gymnasium environments for pool, using FastFiz to simulate the physics of the game. Avaliable environments: - - `SimpleFastFiz-v0`: Observes the position of the balls. + - `FastFiz-v0`: Observes the position of the balls. - `PocketsFastFiz-v0`: Observes the position of the balls and in play state. Pocketed balls position always corresponds to given pocket center. @@ -49,8 +49,8 @@ register( - id="SimpleFastFiz-v0", - entry_point="fastfiz_env.envs:SimpleFastFiz", + id="FastFiz-v0", + entry_point="fastfiz_env.envs:FastFiz", additional_wrappers=(wrappers.TimeLimitInjectionWrapper.wrapper_spec(),), ) diff --git a/src/fastfiz_env/envs/__init__.py b/src/fastfiz_env/envs/__init__.py index f756e1e..542d3de 100644 --- a/src/fastfiz_env/envs/__init__.py +++ b/src/fastfiz_env/envs/__init__.py @@ -3,13 +3,11 @@ """ from . import utils -from .simple_fastfiz import SimpleFastFiz -from .frames_fastfiz import FramesFastFiz +from .fastfiz import FastFiz from .pockets_fastfiz import PocketsFastFiz __all__ = [ "utils", - "SimpleFastFiz", - "FramesFastFiz", + "FastFiz", "PocketsFastFiz", ] diff --git a/src/fastfiz_env/envs/simple_fastfiz.py b/src/fastfiz_env/envs/fastfiz.py similarity index 99% rename from src/fastfiz_env/envs/simple_fastfiz.py rename to src/fastfiz_env/envs/fastfiz.py index bc628c4..73bb4db 100644 --- a/src/fastfiz_env/envs/simple_fastfiz.py +++ b/src/fastfiz_env/envs/fastfiz.py @@ -16,7 +16,7 @@ from ..reward_functions import RewardFunction, DefaultReward -class SimpleFastFiz(gym.Env): +class FastFiz(gym.Env): """FastFiz environment for using different action spaces.""" TOTAL_BALLS = 16 diff --git a/src/tests/envs/test_envs.py b/src/tests/envs/test_envs.py index 5ae81f7..3f63d10 100644 --- a/src/tests/envs/test_envs.py +++ b/src/tests/envs/test_envs.py @@ -1,5 +1,5 @@ import unittest -from fastfiz_env.envs import SimpleFastFiz +from fastfiz_env.envs import FastFiz from fastfiz_env.reward_functions.common import ConstantReward from fastfiz_env.wrappers import TimeLimitInjectionWrapper @@ -7,14 +7,14 @@ class TestSimpleFastFiz(unittest.TestCase): def test_init(self): num_balls = 16 - env = SimpleFastFiz(num_balls=num_balls) + env = FastFiz(num_balls=num_balls) env = TimeLimitInjectionWrapper(env) self.assertEqual(env.observation_space.shape, (16, 2)) self.assertEqual(env.action_space.shape, (3,)) def test_reset(self): num_balls = 16 - env = SimpleFastFiz(num_balls=num_balls) + env = FastFiz(num_balls=num_balls) env = TimeLimitInjectionWrapper(env) obs, info = env.reset() self.assertEqual(obs.shape, (16, 2)) @@ -22,7 +22,7 @@ def test_reset(self): def test_step(self): num_balls = 16 - env = SimpleFastFiz(num_balls=num_balls, reward_function=ConstantReward()) + env = FastFiz(num_balls=num_balls, reward_function=ConstantReward()) env = TimeLimitInjectionWrapper(env) env.reset() action = [0, 0, 60, 0, 0]