import enum

from codes.a_config._rl_parameters.off_policy.parameter_off_policy import PARAMETERS_OFF_POLICY
from codes.e_utils.names import DeepLearningModelName, RLAlgorithmName


class TD3ActionSelectorType(enum.Enum):
    BASIC_ACTION_SELECTOR = 0
    SOMETIMES_BLOW_ACTION_SELECTOR = 1
    NOISY_NET_ACTION_SELECTOR = 2


class TD3ActionType(enum.Enum):
    GAUSSIAN_NOISE = 0
    GAUSSIAN_NOISE_WITH_EPSILON = 1
    ONLY_GREEDY = 2
    AVERAGE_WITH_GAUSSIAN_NOISE = 3


class PARAMETERS_TD3(PARAMETERS_OFF_POLICY):
    DEEP_LEARNING_MODEL = DeepLearningModelName.TD3_MLP
    RL_ALGORITHM = RLAlgorithmName.TD3_V0

    PER_PROPORTIONAL = False
    PER_RANK_BASED = False
    DOUBLE = True

    REPLAY_BUFFER_SIZE = None

    TRAIN_ACTION_NOISE_STD = 1.0
    TRAIN_ACTION_NOISE_CLIP = 1.0

    CLIP_GRAD = 3.0

    TRAIN_STEP_FREQ = 2
    POLICY_UPDATE_FREQUENCY = 2 * TRAIN_STEP_FREQ
    TAU = 0.005

    N_STEP = 2

    EPSILON_INIT = 1.0
    EPSILON_MIN = 0.01
    EPSILON_MIN_STEP = 5000000

    TRAIN_ONLY_AFTER_EPISODE = False
    NUM_TRAIN_ONLY_AFTER_EPISODE = 100

    TYPE_OF_TD3_ACTION = TD3ActionType.GAUSSIAN_NOISE
    TYPE_OF_TD3_ACTION_SELECTOR = TD3ActionSelectorType.BASIC_ACTION_SELECTOR

    DISTRIBUTIONAL = False
    NOISY_NET = False

import enum

from codes.a_config._rl_parameters.off_policy.parameter_off_policy import PARAMETERS_OFF_POLICY
from codes.e_utils.names import DeepLearningModelName, RLAlgorithmName


class TD3ActionSelectorType(enum.Enum):
    BASIC_ACTION_SELECTOR = 0
    SOMETIMES_BLOW_ACTION_SELECTOR = 1
    NOISY_NET_ACTION_SELECTOR = 2


class TD3ActionType(enum.Enum):
    GAUSSIAN_NOISE = 0
    GAUSSIAN_NOISE_WITH_EPSILON = 1
    ONLY_GREEDY = 2
    AVERAGE_WITH_GAUSSIAN_NOISE = 3


class PARAMETERS_TD3(PARAMETERS_OFF_POLICY):
    DEEP_LEARNING_MODEL = DeepLearningModelName.TD3_MLP
    RL_ALGORITHM = RLAlgorithmName.TD3_V0

    PER_PROPORTIONAL = False
    PER_RANK_BASED = False
    DOUBLE = True

    REPLAY_BUFFER_SIZE = None

    TRAIN_ACTION_NOISE_STD = 1.0
    TRAIN_ACTION_NOISE_CLIP = 1.0

    CLIP_GRAD = 3.0

    TRAIN_STEP_FREQ = 2
    POLICY_UPDATE_FREQUENCY = 2 * TRAIN_STEP_FREQ
    TAU = 0.005

    N_STEP = 2

    EPSILON_INIT = 1.0
    EPSILON_MIN = 0.01
    EPSILON_MIN_STEP = 5000000

    TRAIN_ONLY_AFTER_EPISODE = False
    NUM_TRAIN_ONLY_AFTER_EPISODE = 100

    TYPE_OF_TD3_ACTION = TD3ActionType.GAUSSIAN_NOISE
    TYPE_OF_TD3_ACTION_SELECTOR = TD3ActionSelectorType.BASIC_ACTION_SELECTOR

    DISTRIBUTIONAL = False
    NOISY_NET = False
