Heuristic versus LLM Agents in Agricultural Simulation
A distributed simulation testbed for precision agriculture, built to answer a focused question: do large language model agents make better farming decisions than classical rule-based ones, and at what cost? The system models soil-plant dynamics under stochastic weather and pits the two agent families against each other on the same fields.
Architecture
The system is deliberately decoupled into three services:
Simulator: the authoritative physics engine. It maintains global state (water balance, nutrient cycles, plant growth) and exposes it through an API.
MAS: the agents that perceive the field and act (irrigation, fertilisation, harvest). Two interchangeable kinds: heuristic agents with rule-based BDI-lite logic, and LLM agents that reason with OpenAI or Anthropic models.
Visualizer: a Next.js / TypeScript dashboard for live field state, agent logs, and yield metrics.
The physics engine
Soil-water dynamics are driven by realistic models rather than toy rules. Reference evapotranspiration uses the Hargreaves equation,
ET_0 = 0.0023 \,(T_{\text{mean}} + 17.8)\, \sqrt{T_{\max} - T_{\min}} \; R_a ,
with R_a the extraterrestrial radiation, while drainage follows a power-law in soil moisture. Plant stress is tracked as separate nitrogen- and water-stress factors that feed back into growth.
Evaluation
A dedicated harness runs multi-episode simulations and produces statistical reports comparing the agent types on:
Yield and water-use efficiency (yield per unit water),
economic return, and
AI token cost, so the LLM agents’ decisions are judged against what they cost to produce.
This makes the heuristic-vs-LLM comparison an honest one: the language models are held to the same agronomic outcomes and charged for their reasoning.
Source
Implementation and preset scenarios are in the source repository.