Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Env<O, A>

Wrapper for an OpenAI Gym or gym-like environments.

Type parameters

  • O: Space

    Observation space.

  • A: Space

    Action space.

Hierarchy

  • Env

Index

Constructors

constructor

Properties

commander

commander: Commander = null

requester

requester: Requester<Command, string> = null

Methods

actionSample

  • actionSample(): Promise<Action<A>>
  • Generates a random action.

    example
    const action = await env.actionSample()

    Returns Promise<Action<A>>

    Promise with the action.

actionSpace

  • actionSpace(): Promise<A>
  • Generates a dictionary with info about the action space.

    example
    const { name, n } = await env.actionSpace()

    Returns Promise<A>

    Promise with the action space.

close

  • close(): Promise<boolean>
  • Closes the environment.

    example
    const isClosed = await env.close()

    Returns Promise<boolean>

    Promise with the confirmation.

observationSpace

  • observationSpace(): Promise<O>
  • Generates a dictionary with info about the observation space.

    example
    const { name, shape, low, high } = await env.observationSpace()

    Returns Promise<O>

    Promise with the observation space.

reset

  • reset(): Promise<State<O>>
  • Resets the environment and returns the initial state.

    example
    const initialState = await env.reset()

    Returns Promise<State<O>>

    Promise with the initial state.

step

  • Performs a step in the environment.

    example
    const [next_state, reward, done, info] = await env.step([1.5, 2.2])

    Parameters

    • action: Action<A>

      Action to execute.

    Returns Promise<Step<O>>

    Promise with the result of the step.

Generated using TypeDoc