class RandomActionMechanism(ABC):
Known subclasses: rlgt.agents.random_action_mechanisms.ConstantRandomActionMechanism, rlgt.agents.random_action_mechanisms.ExponentialRandomActionMechanism, rlgt.agents.random_action_mechanisms.NoRandomActionMechanism
This abstract class encapsulates the concept of a random action mechanism in the context of an RL agent for graph theory applications. A random action mechanism controls the probability with which the agent selects a random action instead of an action prescribed by its policy. Concrete subclasses that inherit from this class must implement the following abstract property:
random_action_probability, which returns the current random action probability as afloatfrom the interval [0, 1];
as well as the following abstract methods:
reset, which is invoked during the agent initialization and is responsible for initializing the internal state of the random action mechanism; andstep, which is invoked at the end of each iteration of the learning process and determines how the random action probability should be updated based on the previous best score and the current best score.
| Method | reset |
This abstract method must be implemented by any concrete subclass. It is invoked by an RL agent during the initialization process and it must initialize or reset all internal state maintained by the random action mechanism. |
| Method | step |
This abstract method must be implemented by any concrete subclass. It is invoked by an RL agent at the end of each iteration of the learning process and it must update the internal state of the random action mechanism based on the previous best score and the current best score. |
| Property | random |
This abstract property must be implemented by any concrete subclass. It must return the current random action probability as a float value from the interval [0, 1]. |
rlgt.agents.random_action_mechanisms.ConstantRandomActionMechanism, rlgt.agents.random_action_mechanisms.ExponentialRandomActionMechanism, rlgt.agents.random_action_mechanisms.NoRandomActionMechanismThis abstract method must be implemented by any concrete subclass. It is invoked by an RL agent during the initialization process and it must initialize or reset all internal state maintained by the random action mechanism.
rlgt.agents.random_action_mechanisms.ConstantRandomActionMechanism, rlgt.agents.random_action_mechanisms.ExponentialRandomActionMechanism, rlgt.agents.random_action_mechanisms.NoRandomActionMechanismThis abstract method must be implemented by any concrete subclass. It is invoked by an RL agent at the end of each iteration of the learning process and it must update the internal state of the random action mechanism based on the previous best score and the current best score.
| Parameters | |
previousfloat | The value of the best score before the current iteration, given
as a float. |
currentfloat | The value of the best score after the current iteration, given
as a float. |
rlgt.agents.random_action_mechanisms.ConstantRandomActionMechanism, rlgt.agents.random_action_mechanisms.ExponentialRandomActionMechanism, rlgt.agents.random_action_mechanisms.NoRandomActionMechanismThis abstract property must be implemented by any concrete subclass. It must return the
current random action probability as a float value from the interval [0, 1].