PPolySim OS

Q-Learning Gridworld

Reinforcement learning learns by reward. Watch an agent discover the best route through a gridworld — toward the goal, around the trap.

Q-Learning GridworldLive

Controls

Presets

Reinforcement learning finds a policy — an arrow in every cell — that maximizes long-term reward. A high discount γ makes the agent value the distant goal; a costlier step reward pushes it to take the shortest path. The colors show each cell's learned value. Educational tool.

▶ Run in Python

Data Inspector

Discount γ0.90
Start-cell value0.09
Behaviorcautious path

Governing equation

Reading this result: With γ=0.9 and a mild step reward, the agent balances path length against reaching the goal, favoring a steady route.

Runs locally in your browser — free forever. Scale to the cloud when reality gets heavy.

or unlock everything with Pro →
★ Sign in to save this setup
Save your tuned setup, or drop this simulation into your own site, docs, or course page.

How it works

Q-learning estimates the long-term value of each action and derives a policy that maximizes cumulative reward. The discount factor sets how much the agent values the distant goal, and the per-step cost pushes it toward efficient paths. The arrows show the learned optimal policy. Educational tool.

Ask the AI about this model

The math, the assumptions, real-world uses, or a code translation — explained for this exact simulation.

More CS / AI simulations

Frequently asked questions

Is this q-learning gridworld simulator tool really free?
Yes. Q-Learning Gridworld runs entirely in your browser using your device's own compute, so local use is free forever. You only pay Compute Tokens if you scale a job to the cloud.
Do I need to install anything?
No. Everything runs client-side in a modern browser — no downloads, no license, no account required to start.
Can I save or share my simulation?
Create a free account to save projects, and use a shareable embed or minted DOI to publish a live, interactive version anywhere.
How accurate are the results?
The solver uses established numerical methods, but results are for research and educational purposes and should be validated against experiment or professional review before you rely on them.