Options
All
  • Public
  • Public/Protected
  • All
Menu

gym.js

Index

Type aliases

actionSpace

actionSpace: Discrete[] | number | number[]

Functions

decodeAction

  • decodeAction(action: actionSpace, movements: string[]): __type
  • Decode the algorithmic env tuple action_space into an object containing the decoded movement, write boolean, and the character to write.

    Parameters

    • action: actionSpace

      An action in the action_space of the env.

    • movements: string[]

      The allowed movements of the env.

    Returns __type

randint

  • randint(s1: number, s2?: number, n?: number): number | number[]
  • Get a random array of integers with size n in the range [0; s1) or [s1, s2).

    Parameters

    • s1: number

      The maximum random value (not inclusive) if s2 is undefined else the minimum (inclusive).

    • Optional s2: number

      The maximum random value (not inclusive).

    • Optional n: number

      The size of the array to return. If 1, returns number.

    Returns number | number[]

    • An array of random values.

range

  • range(s1: number, s2?: number): number[]
  • Get a range of numbers.

    Parameters

    • s1: number

      The end of the range if s2 is undefined else the start. Starting at 0.

    • Optional s2: number

      The end of the range.

    Returns number[]

toArrayLike

  • toArrayLike(obj: any): []
  • Convert an array-like type to an actual array.

    Parameters

    • obj: any

    Returns []

toNumLike

  • toNumLike(obj: any): number
  • Convert a num-like type to an actual number.

    Parameters

    • obj: any

    Returns number

Generated using TypeDoc