Interface RlEnv

All Superinterfaces:
AutoCloseable

public interface RlEnv extends AutoCloseable
An environment to use for reinforcement learning.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A record of taking a step in the environment.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Returns the current actions that can be taken in the environment.
    Returns a batch of steps from the environment ReplayBuffer.
    Returns the observation detailing the current state of the environment.
    void
    Resets the environment to it's default state.
    default float
    runEnvironment(RlAgent agent, boolean training)
    Runs the environment from reset until done.
    step(NDList action, boolean training)
    Takes a step by performing an action in this environment.
  • Method Details

    • reset

      void reset()
      Resets the environment to it's default state.
    • getObservation

      NDList getObservation()
      Returns the observation detailing the current state of the environment.
      Returns:
      the observation detailing the current state of the environment
    • getActionSpace

      ActionSpace getActionSpace()
      Returns the current actions that can be taken in the environment.
      Returns:
      the current actions that can be taken in the environment
    • step

      RlEnv.Step step(NDList action, boolean training)
      Takes a step by performing an action in this environment.
      Parameters:
      action - the action to perform
      training - true if the step is during training
      Returns:
      the RlEnv.Step with the result of the action
    • runEnvironment

      default float runEnvironment(RlAgent agent, boolean training)
      Runs the environment from reset until done.
      Parameters:
      agent - the agent to choose the actions with
      training - true to run while training. When training, the steps will be recorded
      Returns:
      the total reward
    • getBatch

      RlEnv.Step[] getBatch()
      Returns a batch of steps from the environment ReplayBuffer.
      Returns:
      a batch of steps from the environment ReplayBuffer
    • close

      void close()
      Specified by:
      close in interface AutoCloseable