<filename>codes/a_config/e_real_device/parameters_quanser_rip_ppo.py
import math

from codes.a_config._rl_parameters.off_policy.parameter_td3 import PARAMETERS_TD3, TD3ActionType, TD3ActionSelectorType
from codes.a_config._rl_parameters.on_policy.parameter_ppo import PARAMETERS_PPO
from codes.e_utils.names import *
from codes.a_config.parameters_general import PARAMETERS_GENERAL, StochasticActionType, StochasticActionSelectorType


class PARAMETERS_QUANSER_RIP_PPO(PARAMETERS_GENERAL, PARAMETERS_PPO):
    ENVIRONMENT_ID = EnvironmentName.QUANSER_SERVO_2
    RL_ALGORITHM = RLAlgorithmName.CONTINUOUS_PPO_V0
    DEEP_LEARNING_MODEL = DeepLearningModelName.CONTINUOUS_STOCHASTIC_ACTOR_CRITIC_MLP

    VELOCITY_STATE_DENOMINATOR = 100.0

    TRAIN_STOP_EPISODE_REWARD = 7000  # MAX: 3.14 * 10000 = 31400
    TRAIN_STOP_EPISODE_REWARD_STD = 50.0
    STOP_PATIENCE_COUNT = 10

    MAX_EPISODE_STEP_AT_PLAY = 10000000000
    MAX_EPISODE_STEP = 10000
    MAX_GLOBAL_STEP = 10000000
    GAMMA = 0.99

    BATCH_SIZE = 128
    AVG_EPISODE_SIZE_FOR_STAT = 50

    ## PPO
    PPO_GAE_LAMBDA = 0.70
    PPO_TRAJECTORY_SIZE = 2049
    PPO_TRAJECTORY_BATCH_SIZE = 128
    ACTOR_LEARNING_RATE = 0.0002
    LEARNING_RATE = 0.001
    PPO_K_EPOCHS = 5
    PPO_EPSILON_CLIP = 0.2
    N_STEP = 1

    TRAIN_ONLY_AFTER_EPISODE = False
    NUM_TRAIN_ONLY_AFTER_EPISODE = 100

    ACTION_SCALE = 250.0

    UNIT_TIME = 0.005

    TYPE_OF_STOCHASTIC_ACTION = StochasticActionType.SAMPLE
    TYPE_OF_STOCHASTIC_ACTION_SELECTOR = StochasticActionSelectorType.SOMETIMES_BLOW_ACTION_SELECTOR

    VERBOSE_TO_LOG = False

<filename>codes/a_config/e_real_device/parameters_quanser_rip_ppo.py
import math

from codes.a_config._rl_parameters.off_policy.parameter_td3 import PARAMETERS_TD3, TD3ActionType, TD3ActionSelectorType
from codes.a_config._rl_parameters.on_policy.parameter_ppo import PARAMETERS_PPO
from codes.e_utils.names import *
from codes.a_config.parameters_general import PARAMETERS_GENERAL, StochasticActionType, StochasticActionSelectorType


class PARAMETERS_QUANSER_RIP_PPO(PARAMETERS_GENERAL, PARAMETERS_PPO):
    ENVIRONMENT_ID = EnvironmentName.QUANSER_SERVO_2
    RL_ALGORITHM = RLAlgorithmName.CONTINUOUS_PPO_V0
    DEEP_LEARNING_MODEL = DeepLearningModelName.CONTINUOUS_STOCHASTIC_ACTOR_CRITIC_MLP

    VELOCITY_STATE_DENOMINATOR = 100.0

    TRAIN_STOP_EPISODE_REWARD = 7000  # MAX: 3.14 * 10000 = 31400
    TRAIN_STOP_EPISODE_REWARD_STD = 50.0
    STOP_PATIENCE_COUNT = 10

    MAX_EPISODE_STEP_AT_PLAY = 10000000000
    MAX_EPISODE_STEP = 10000
    MAX_GLOBAL_STEP = 10000000
    GAMMA = 0.99

    BATCH_SIZE = 128
    AVG_EPISODE_SIZE_FOR_STAT = 50

    ## PPO
    PPO_GAE_LAMBDA = 0.70
    PPO_TRAJECTORY_SIZE = 2049
    PPO_TRAJECTORY_BATCH_SIZE = 128
    ACTOR_LEARNING_RATE = 0.0002
    LEARNING_RATE = 0.001
    PPO_K_EPOCHS = 5
    PPO_EPSILON_CLIP = 0.2
    N_STEP = 1

    TRAIN_ONLY_AFTER_EPISODE = False
    NUM_TRAIN_ONLY_AFTER_EPISODE = 100

    ACTION_SCALE = 250.0

    UNIT_TIME = 0.005

    TYPE_OF_STOCHASTIC_ACTION = StochasticActionType.SAMPLE
    TYPE_OF_STOCHASTIC_ACTION_SELECTOR = StochasticActionSelectorType.SOMETIMES_BLOW_ACTION_SELECTOR

    VERBOSE_TO_LOG = False

# MAX: 3.14 * 10000 = 31400 ## PPO