Done func dict wrapper
Air Force Research Laboratory (AFRL) Autonomous Capabilities Team (ACT3) Reinforcement Learning (RL) Core.
This is a US Government Work not subject to copyright protection in the US.
The use, dissemination or disclosure of data in this file is subject to limitation or restriction. See accompanying README and LICENSE for details.
BaseDictWrapperDone (DoneFuncBase)
¤
A base object that dones can inherit in order to "wrap" multiple done instances, addressed by keys
Source code in corl/dones/done_func_dict_wrapper.py
class BaseDictWrapperDone(DoneFuncBase):
"""A base object that dones can inherit in order to "wrap" multiple done instances, addressed by keys
"""
def __init__(self, **kwargs) -> None:
self.config: BaseDictWrapperDoneValidator
super().__init__(**kwargs)
@property
def get_validator(self) -> typing.Type[BaseDictWrapperDoneValidator]:
return BaseDictWrapperDoneValidator
def dones(self) -> typing.Dict[str, DoneFuncBase]:
"""Get the wrapped done instance dict
"""
return self.config.wrapped
@abc.abstractmethod
def __call__(
self,
observation: OrderedDict,
action: OrderedDict,
next_observation: OrderedDict,
next_state: StateDict,
observation_space: StateDict,
observation_units: StateDict,
) -> DoneDict:
...
get_validator: Type[corl.dones.done_func_dict_wrapper.BaseDictWrapperDoneValidator]
property
readonly
¤
get validator for this Done Functor
Returns:
Type | Description |
---|---|
Type[corl.dones.done_func_dict_wrapper.BaseDictWrapperDoneValidator] |
DoneFuncBaseValidator -- validator the done functor will use to generate a configuration |
dones(self)
¤
Get the wrapped done instance dict
Source code in corl/dones/done_func_dict_wrapper.py
def dones(self) -> typing.Dict[str, DoneFuncBase]:
"""Get the wrapped done instance dict
"""
return self.config.wrapped
BaseDictWrapperDoneValidator (DoneFuncBaseValidator)
pydantic-model
¤
wrapped - the wrapped done instances and their keys
Source code in corl/dones/done_func_dict_wrapper.py
class BaseDictWrapperDoneValidator(DoneFuncBaseValidator):
"""
wrapped - the wrapped done instances and their keys
"""
wrapped: typing.Dict[str, DoneFuncBase]
class Config: # pylint: disable=C0115, R0903
arbitrary_types_allowed = True