# Path: lcs/strategies/action_selection/EpsilonGreedy.py
# class EpsilonGreedy:
# 
#     def __init__(self, all_actions: int, **kwargs):
#         self.all_actions = all_actions
#         self.epsilon = kwargs['epsilon']
#         assert 0 <= self.epsilon <= 1
# 
#     def __call__(self, population) -> int:
#         if np.random.uniform() > self.epsilon:
#             return BestAction(all_actions=self.all_actions)(population)
#         else:
#             return RandomAction(all_actions=self.all_actions)(population)


import lcs.agents.acs as acs
from lcs.strategies.action_selection import EpsilonGreedy


class Configuration(acs.Configuration):
    def __init__(self, **kwargs):
        super(Configuration, self).__init__(**kwargs)

        # RL discount factor
        self.gamma: float = kwargs.get('gamma', 0.95)

        # use of Probability-Enhanced-Effects (PEE)
        self.do_pee: bool = kwargs.get('do_pee', False)

        # use of genetic generalization algorithm
        self.do_ga: bool = kwargs.get('do_ga', False)

        self.theta_ga: int = kwargs.get('theta_ga', 100)

        # probability of mutating single attribute
        self.mu: float = kwargs.get('mu', 0.3)

        # probability of crossover
        self.chi: float = kwargs.get('chi', 0.8)

        # use of action planning mechanism

# Path: lcs/strategies/action_selection/EpsilonGreedy.py
# class EpsilonGreedy:
# 
#     def __init__(self, all_actions: int, **kwargs):
#         self.all_actions = all_actions
#         self.epsilon = kwargs['epsilon']
#         assert 0 <= self.epsilon <= 1
# 
#     def __call__(self, population) -> int:
#         if np.random.uniform() > self.epsilon:
#             return BestAction(all_actions=self.all_actions)(population)
#         else:
#             return RandomAction(all_actions=self.all_actions)(population)


# Path: lcs/agents/acs2/Configuration.py
import lcs.agents.acs as acs
from lcs.strategies.action_selection import EpsilonGreedy



class Configuration(acs.Configuration):
    def __init__(self, **kwargs):
        super(Configuration, self).__init__(**kwargs)

        # RL discount factor
        self.gamma: float = kwargs.get('gamma', 0.95)

        # use of Probability-Enhanced-Effects (PEE)
        self.do_pee: bool = kwargs.get('do_pee', False)

        # use of genetic generalization algorithm
        self.do_ga: bool = kwargs.get('do_ga', False)

        self.theta_ga: int = kwargs.get('theta_ga', 100)

        # probability of mutating single attribute
        self.mu: float = kwargs.get('mu', 0.3)

        # probability of crossover
        self.chi: float = kwargs.get('chi', 0.8)

        # use of action planning mechanism

        self.do_action_planning: bool = kwargs.get('do_action_planning', False)