std1.0.0-beta-7 SafeC docs

std :: ml::rl

Struct std::CartPole

#include <std/ml/rl.h> source

struct CartPole {
    float x;
    float xDot;
    float theta;
    float thetaDot;
    unsigned long steps;
    unsigned long maxSteps;
    struct Rng rng;
}

Fields

§float xsource
§float xDotsource
§float thetasource
§float thetaDotsource
§unsigned long stepssource
§unsigned long maxStepssource

500 (CartPole-v1)

§struct Rng rngsource

Methods

§void reset(&FloatTensor obs)source · definition
§struct EnvStep step(unsigned long action, &FloatTensor obs)source · definition

Reward 1 per step; terminated when |x| > 2.4 or |theta| > 12 degrees, truncated at maxSteps.

§static struct CartPole new(unsigned long seed)source · definition