"""Implementation of Advantage-Actor Critic Agent."""
from rllib.algorithms.gaac import GAAC
from rllib.value_function import NNValueFunction

from .actor_critic_agent import ActorCriticAgent


class GAACAgent(ActorCriticAgent):
    """Implementation of the Advantage-Actor Critic.

    TODO: build compatible function approximation.

    References
    ----------
    <NAME>., <NAME>., <NAME>., <NAME>., & <NAME>. (2015).
    High-dimensional continuous control using generalized advantage estimation. ICLR.
    """

    def __init__(self, lambda_=0.97, *args, **kwargs):
        super().__init__(algorithm_=GAAC, lambda_=lambda_, *args, **kwargs)

    @classmethod
    def default(cls, environment, critic=None, *args, **kwargs):
        """See `AbstractAgent.default'."""
        if critic is None:
            critic = NNValueFunction.default(environment)
        return super().default(environment, critic=critic, *args, **kwargs)

"""Implementation of Advantage-Actor Critic Agent."""
from rllib.algorithms.gaac import GAAC
from rllib.value_function import NNValueFunction

from .actor_critic_agent import ActorCriticAgent


class GAACAgent(ActorCriticAgent):
    """Implementation of the Advantage-Actor Critic.

    TODO: build compatible function approximation.

    References
    ----------
    <NAME>., <NAME>., <NAME>., <NAME>., & <NAME>. (2015).
    High-dimensional continuous control using generalized advantage estimation. ICLR.
    """

    def __init__(self, lambda_=0.97, *args, **kwargs):
        super().__init__(algorithm_=GAAC, lambda_=lambda_, *args, **kwargs)

    @classmethod
    def default(cls, environment, critic=None, *args, **kwargs):
        """See `AbstractAgent.default'."""
        if critic is None:
            critic = NNValueFunction.default(environment)
        return super().default(environment, critic=critic, *args, **kwargs)

Implementation of Advantage-Actor Critic Agent. Implementation of the Advantage-Actor Critic.      TODO: build compatible function approximation.      References     ----------     <NAME>., <NAME>., <NAME>., <NAME>., & <NAME>. (2015).     High-dimensional continuous control using generalized advantage estimation. ICLR. See `AbstractAgent.default'.