Hardcode
Stage 1 - four if-then rules. No machine learning, and that is exactly the point.
The simplest brain in the world: four if-then rules, expressed over the state index.
function hardAction(s) {
if (s & 8) return 3; // carrying sugar → ZUM_BAU
if (s & 4) return 1; // sees sugar → ZUM_ZUCKER
if (s & 2) return 2; // smells trail → FOLGE_SPUR
return 0; // else → ERKUNDE
}
Agent lesson: This is not machine learning - and that is the point. Hit reset and the colony behaves identically. No model, no training. Yet it is a full agent: it has a policy (
state → action). Remember this table. The next stage will try to find it on its own.