How aamirsahil/antforagesim works
AntForageSim is a browser-based ant-foraging simulation. Users configure and run it through the page controls; the controller creates and advances a simulation, which updates the world, cells, and learning agents. The controller then refreshes the canvas and dashboard. The excerpts document these runtime calls and the agent’s Q-learning, but the README gives no further product description; unsampled files and wiring are not inferred.
Main entry points: index.js Page controller · simulation.js Simulation · world.js World state · agent.js Ant agent
Components 11
Controls and display
- Page controller
index.js - World canvas
canvas.js - Stats dashboard
dom.js
Simulation runtime
- Simulation
simulation.js
Foraging and learning
- Ant agent
agent.js - Q-learning
qlearn.js
World environment
- World state
world.js - Grid cell
cell.js - Default map
map.js
Other components
- User
- Plotly charts
Connections 11
- User → Page controller: operates controls
index.js - Page controller → Simulation: creates and updates
index.js - Simulation → World state: creates and updates
simulation.js - Simulation → Default map: loads map
simulation.js - World state → Grid cell: creates and updates
world.js - World state → Ant agent: updates agents
world.js - Simulation → Ant agent: creates agents
simulation.js - Ant agent → Q-learning: learns and selects
agent.js - Page controller → World canvas: renders world
index.js - Page controller → Stats dashboard: updates stats
index.js - Stats dashboard → Plotly charts: extends charts
dom.js