Source code for epyt_control.envs.actions.actions

 1"""
 2This module contains a base class for actions.
 3"""
 4from abc import abstractmethod
 5from gymnasium.spaces import Space
 6from epyt_flow.gym import ScenarioControlEnv
 7
 8
[docs] 9class Action(): 10 """ 11 Base class for actions. 12 """
[docs] 13 @abstractmethod 14 def to_gym_action_space(self) -> Space: 15 """ 16 Converts this action to a 17 `gymnasium.spaces.Space <https://gymnasium.farama.org/api/spaces/#gymnasium.spaces.Space>`_ 18 instance. 19 20 Returns 21 ------- 22 `gymnasium.spaces.Space <https://gymnasium.farama.org/api/spaces/#gymnasium.spaces.Space>`_ 23 gymnasium.spaces.Space instance. 24 """ 25 raise NotImplementedError()
26
[docs] 27 @abstractmethod 28 def apply(self, env: ScenarioControlEnv, action_value) -> None: 29 """ 30 Applies a given action (from the action space) in a given environment. 31 32 Parameters 33 ---------- 34 env : `epyt_flow.gym.ScenarioControlEnv <https://epyt-flow.readthedocs.io/en/stable/epyt_flow.gym.html#epyt_flow.gym.scenario_control_env.ScenarioControlEnv>`_ 35 The environment. 36 action_value: Any 37 The action. 38 """ 39 raise NotImplementedError()