ForagerRL - gama-platform/gama GitHub Wiki

The Smart Forager — Reinforcement Learning in GAMA

By Killian Trouillet

Welcome to the comprehensive tutorial on Reinforcement Learning with the GAMA platform. You will build a forager agent that learns to navigate toward food while avoiding obstacles — from a simple grid world to a continuous environment trained with Deep RL.


Part 1: Internal RL (GAML only)

Build a tabular Q-Learning agent entirely in GAML, step by step:

  1. Step 1: The Grid World — Create the 10×10 environment with food and obstacles.
  2. Step 2: The Forager Agent — Define a simple agent that moves randomly.
  3. Step 3: Rewards and Episodes — Implement the reward system and simulation resets.
  4. Step 4: The Q-Table — Set up the agent's memory using map<string, float>.
  5. Step 5: Q-Learning Algorithm — Implement the Bellman equation and ε-greedy policy.
  6. Step 6: Visualization & Automatic Test — Add charts, heatmaps, and evaluate the learned policy.

Expected console output after training and testing

⚠️ **GitHub.com Fallback** ⚠️