How gjmcn/atomic-agents works
Project Type and Purpose
• Atomic Agents is an open-source JavaScript module (npm package) for spatial agent-based modeling.
• It provides a collection of geometry utilities, spatial region functions, random-sampling, and simulation primitives (agents, actors, zones).
File Structure Analysis
• Top-level files: configuration (package.json, .gitignore), licensing (LICENSE), changelog, README.
• src/ directory: the core implementation broken into multiple ES modules:
• Geometry & vector math (vector.js, polyline.js, boundary-distance.js, etc.)
• Spatial constructs (grid.js, regions.js, zone.js, autotile.js)
• Random sampling & helpers (random.js, random-circles.js, helpers.js)
• Simulation primitives (agent.js, actor.js, simulation.js)
• Entry point (index.js) exporting the public API.
• __tests__/: unit tests for every major function/module.
• docs/: static site with API reference and examples.
Insights from README
• The package is intended for interactive spatial simulations (e.g., disease spread models).
• No external services—pure client or Node.js library.
• Extensible API for plugging in custom agent behaviors and geometry-based interactions.