AgentMaps Documentation

repository·master·Indexed 21 days ago

https://github.com/noncomputable/agentmaps

A 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.

Tokens
501
Snippets
3
Records
4
Agent score
26%

What's inside AgentMaps

  1. Overview of AgentMaps

    master
    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.
  2. Include AgentMaps in a webpage via CDN

    master

    To 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>
  3. Use the AgentMaps library via the L.A namespace

    master

    The 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 through L.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