Class EpsilonGreedy

  • All Implemented Interfaces:
    RlAgent

    public class EpsilonGreedy
    extends java.lang.Object
    implements RlAgent
    The EpsilonGreedy is a simple exploration/excitation agent.

    It helps other agents explore their environments during training by sometimes picking random actions.

    If a model based agent is used, it will only explore paths through the environment that have already been seen. While this is sometimes good, it is also important to sometimes explore new paths as well. This agent exhibits a tradeoff that takes random paths a fixed percentage of the time during training.

    • Constructor Detail

      • EpsilonGreedy

        public EpsilonGreedy​(RlAgent baseAgent,
                             Tracker exploreRate)
        Constructs an EpsilonGreedy.
        Parameters:
        baseAgent - the (presumably model-based) agent to use for exploitation and to train
        exploreRate - the probability of taking a random action
    • Method Detail

      • chooseAction

        public NDList chooseAction​(RlEnv env,
                                   boolean training)
        Chooses the next action to take within the RlEnv.
        Specified by:
        chooseAction in interface RlAgent
        Parameters:
        env - the current environment
        training - true if the agent is currently traning
        Returns:
        the action to take