Begin rllib
This commit is contained in:
@@ -39,7 +39,8 @@ dependencies = [
|
|||||||
"tensorflow==2.12.0",
|
"tensorflow==2.12.0",
|
||||||
"typer[all]==0.9.0",
|
"typer[all]==0.9.0",
|
||||||
"pydantic==2.1.1",
|
"pydantic==2.1.1",
|
||||||
"enlighten==1.12.2"
|
"enlighten==1.12.2",
|
||||||
|
"ray[rllib] == 2.8.0, < 3"
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.setuptools.dynamic]
|
[tool.setuptools.dynamic]
|
||||||
|
|||||||
18
src/primaite/game/policy/rllib.py
Normal file
18
src/primaite/game/policy/rllib.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
|
||||||
|
|
||||||
|
from typing import Literal, Optional, Type, TYPE_CHECKING, Union
|
||||||
|
|
||||||
|
from primaite.game.policy import PolicyABC
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from primaite.game.session import PrimaiteSession, TrainingOptions
|
||||||
|
|
||||||
|
from ray.rllib
|
||||||
|
|
||||||
|
|
||||||
|
class RaySingleAgentPolicy(PolicyABC, identifier="RLLIB_single_agent"):
|
||||||
|
"""Single agent RL policy using Ray RLLib."""
|
||||||
|
|
||||||
|
def __init__(self, session: "PrimaiteSession", algorithm: Literal["PPO", "A2C"], seed: Optional[int] = None):
|
||||||
|
super().__init__(session=session)
|
||||||
|
|
||||||
Reference in New Issue
Block a user