CartPole: CartPole Object

Description Usage Arguments Details Value Methods (by generic) Examples

View source: R/cartpole.R

Description

The function CartPole() creates a CartPole object. The CartPole class is inherited from the Env class.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
CartPole(
  internal_state = vector("numeric", 4),
  rng_state = .Random.seed,
  setting = list()
)

## S3 method for class 'CartPole'
Step(x, action)

## S3 method for class 'CartPole'
Reset(x)

Arguments

internal_state

vector of size 4, representing cart position, cart velocity, pole angle, and pole angular velocity

rng_state

the RNG state for non-deterministic evolution

setting

a list of constants that controls the setting of the CartPole object, see details.

x

an environment-like object

action

an action from agent

Details

The internal state of a CartPole object includes four elements (following OpenAI Gym convention):

Index Observation
1 Cart Position
2 Cart Velocity
3 Pole Angle
4 Pole Angular Velocity

Note that the θ (index 3 and 4) has the opposite sign to OpenAI Gym. In our definition, anti-clockwise is positive direction.

Value

a CartPole object (class = c("CartPole", "Env"))

Methods (by generic)

Examples

1
cp <- CartPole()

XiaoqiLu/PhD-Thesis documentation built on March 1, 2021, 10:49 a.m.