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.Box of shape [4] -- x, x_dot, theta, theta_dot.
Actions: Fehu.Space.Discrete 2 -- 0 = push left, 1 = push right.
Render modes: ansi.
#
type obs = Nx.host Nx.float32_t#
type act = Nx.host Nx.int32_t#
type render = string#
val make :
?render_mode:Fehu.Env.render_mode ->
unit ->
(obs, act, render) Fehu.Env.tmake () is a cart-pole environment.