You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
679 B
25 lines
679 B
from copy import deepcopy
|
|
from typing import Optional
|
|
|
|
import gymnasium as gym
|
|
|
|
from decoupled_wbc.control.base.policy import Policy
|
|
|
|
|
|
class IdentityPolicy(Policy):
|
|
def __init__(self):
|
|
self.reset()
|
|
|
|
def get_action(self, time: Optional[float] = None) -> dict[str, any]:
|
|
return self.goal
|
|
|
|
def set_goal(self, goal: dict[str, any]) -> None:
|
|
self.goal = deepcopy(goal)
|
|
self.goal.pop("interpolation_garbage_collection_time", None)
|
|
self.goal.pop("target_time", None)
|
|
|
|
def observation_space(self) -> gym.spaces.Dict:
|
|
return gym.spaces.Dict()
|
|
|
|
def action_space(self) -> gym.spaces.Dict:
|
|
return gym.spaces.Dict()
|