Skip to content

Done func multi 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.


BaseMultiWrapperDone (DoneFuncBase) ¤

A base object that dones can inherit in order to "wrap" a single done instance

Source code in corl/dones/done_func_multi_wrapper.py
class BaseMultiWrapperDone(DoneFuncBase):
    """A base object that dones can inherit in order to "wrap" a single done instance
    """

    def __init__(self, **kwargs) -> None:
        self.config: BaseMultiWrapperDoneValidator
        super().__init__(**kwargs)

    @property
    def get_validator(self) -> typing.Type[BaseMultiWrapperDoneValidator]:
        return BaseMultiWrapperDoneValidator

    def dones(self) -> typing.List[DoneFuncBase]:
        """Get the wrapped done instance
        """
        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_multi_wrapper.BaseMultiWrapperDoneValidator] property readonly ¤

get validator for this Done Functor

Returns:

Type Description
Type[corl.dones.done_func_multi_wrapper.BaseMultiWrapperDoneValidator]

DoneFuncBaseValidator -- validator the done functor will use to generate a configuration

dones(self) ¤

Get the wrapped done instance

Source code in corl/dones/done_func_multi_wrapper.py
def dones(self) -> typing.List[DoneFuncBase]:
    """Get the wrapped done instance
    """
    return self.config.wrapped

BaseMultiWrapperDoneValidator (DoneFuncBaseValidator) pydantic-model ¤

wrapped - the wrapped done instance

Source code in corl/dones/done_func_multi_wrapper.py
class BaseMultiWrapperDoneValidator(DoneFuncBaseValidator):
    """
    wrapped - the wrapped done instance
    """
    wrapped: typing.List[DoneFuncBase]

    class Config:  # pylint: disable=C0115, R0903
        arbitrary_types_allowed = True