github ↗
docs menu

Module Fehu_envs.Mountain_car

Mountain car with sparse reward (MountainCar-v0).

A car sits in a valley between two hills. The engine is too weak to climb the right hill directly; the agent must build momentum by rocking back and forth. Reward is -1.0 per step. The episode terminates when the car reaches position >= 0.5 with non-negative velocity, and truncates at 200 steps.

Observation: Fehu.Space.Box of shape [2] -- position, velocity.

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

Render modes: ansi.

#type act = Nx.host Nx.int32_t
#type render = string
#val make : ?render_mode:Fehu.Env.render_mode -> unit -> (obs, act, render) Fehu.Env.t

make () is a mountain car environment.