Module Fehu_envs.Cartpole

Classic cart-pole balancing (CartPole-v1).

A pole is attached to a cart on a frictionless track. The agent pushes the cart left or right to keep the pole upright. Reward is +1.0 per step while the pole stays up. The episode terminates when the pole exceeds +/-12 degrees or the cart leaves +/-2.4, and truncates at 500 steps.

Observation: Fehu.Space.spec.Box of shape [4] -- x, x_dot, theta, theta_dot.

Actions: Fehu.Space.spec.Discrete 2 -- 0 = push left, 1 = push right.

Render modes: ansi.

type obs = (float, Nx.float32_elt) Nx.t
type act = (int32, Nx.int32_elt) Nx.t
type render = string
val make : ?render_mode:Fehu.Env.render_mode -> unit -> (obs, act, render) Fehu.Env.t

make () is a cart-pole environment.