An agent-based crowd simulator in 2D, loosely based on noncomputable/agentmaps by Andrew Gregory Tsesis. The main differences are:
- This version is running as a server in Node.js, and it can be queried to return the agents' positions and state.
- It is written in TypeScript
- Building units are taken from OSM data, and not generated on-the-fly
Aim is to create a micro-simulator that simulates large groups of people and traffic as input for the evaluation of threat scenarios. It does not aim to be a very realistic crowd or traffic simulator.
Prerequisites: you need to have a working version of Docker running on your machine.
- Setup OSRM, the Open Source routing machine. See the readme in
docker/osrm-services
. Note that you do not need to run it from there, as OSRM is started as part of thedocker-compose.yml
file in Kafka. - Start Kafka, see
packages/kafka
, for running the GUI. - Start Agent Smith Simulator, see
packages/ass
. You can use VSCode's launch file to run it.
The name is inspired by Agent Smith in the film The Matrix.
pnpm i
cd packages/shared/
npm run link
cd ../gui
npm run link
npm start
An explanation on how to edit scenarios and how the ineraction between agents is implemented can be found in the README file in the folder ./docs
This project also includes a simulation viewer (named COPPER). This viewer consists of a server that listens to all simulation events published on Kafka and a webclient. The viewer is included in the docker-compose and is available at http://localhost:3008/.
Used for creating a routing service for driving, cycling, and walking. These routing services are used by the agents to compute their routes. Please see docker/osrm-services
how to set it up.
See their website.
See the website.
The basic idea is that the main service has knowledge about all agent-smith simulator services (ASS services), and that it can split the map and share it between all simulators. Each ASS will also receive a list of all map boundaries, and a high-level road network, so routing is possible from the local map to another map. When an agent leaves an ASS, it will deregister with the current ASS and register with the new ASS via TCP/IP.
An agent can also have children: these children will either have a fixed relative position to the parent agent, e.g. to simulate people in a bus, or a dynamic relative position, e.g. to simulate people walking in a group. Nesting is limited to 2 levels, so we can also simulate a family group walking inside a tour group. Agents can leave or join a group when needed.
On an Ubuntu machine, run the following commands:
git clone https://github.com/openmaptiles/openmaptiles.git
cd openmaptiles
sudo ./quickstart.sh netherlands # assuming you want to create mbtiles from The Netherlands (replace with the name known at geofabrik).
- Woman icon by Icons8: https://icons8.com/icon/21829/woman
- Bicycle icon by Icons8: https://icons8.com/icon/91006/bicycle
- Drone icon by Icons8: https://icons8.com/icon/21919/drone
- Bomb icon by Icons8: https://icons8.com/icon/22459/bomb
- Cloud icon by Icons8: https://icons8.com/icon/156/cloud
- Question Mark icon by Icons8: https://icons8.com/icon/10568/question-mark
- Grenade icon by Icons8: https://icons8.com/icon/10556/grenade