AgentMaps Documentation
repository·master·Indexed 21 days ago
https://github.com/noncomputable/agentmapsA geospatial agent-based modeling and simulation (ABMS) library for JavaScript that enables the creation of complex social simulations by placing programmable agents on real-world maps. The library integrates with Leaflet and exposes its core functionalities, including agent management and building definitions, through the L.A namespace.
What's inside AgentMaps
- AgentMaps is a JavaScript library designed for building and visualizing agent-based simulations on real-world maps. It allows for programmable agents at various levels of granularity, representing entities such as people, vehicles, animals, or infectious agents. The library integrates with geospatial maps to turn static map data into dynamic social simulations.
Install AgentMaps via npm
masterYou can install AgentMaps as an npm package to bundle it within your own build pipeline.
npm install agentmapsInclude AgentMaps in a webpage via CDN
masterTo use AgentMaps directly in a webpage without a build step, you can include a premade bundle. Note that you must also include Leaflet separately as a dependency.
<!-- Include Leaflet separately --> <link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" /> <script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script> <!-- Include AgentMaps bundle --> <script src="https://unpkg.com/agentmaps@2/site/dist/agentmaps.js"></script>Use the AgentMaps library via the L.A namespace
masterThe AgentMaps library is exposed through a single global or module-level namespace
L.A. This namespace aggregates all core functionalities, including agent management, building definitions, and map simulations. To use the library, access its features throughL.A.const LA = require('agentmaps'); // Assuming the package is installed // All functionality is available under the L.A object // e.g., LA.agentmap, LA.agents, LA.buildings, LA.utils