Djinn is a framework for writing distributed agent-based simulations (ABMs), providing:
- a structure for defining agents and their behaviors/decision-making along with some extensions for common behaviors.
- a distributed architecture mediated by Redis which allows computationally-intense agents to be processed in parallel across multiple processes and/or multiple machines.
- utilities for logging and emitting events during the simulation, e.g. to a websocket frontend.
For examples refer to the
Extensions to provide commonly-used, but non-core, functionality.
Struct containing a unique id and a state.
Manages a simulation and coordinates a set of workers.
An interface to the Redis-backed agent population.
A container for queuing and synchronizing agent updates.
A WebSocket server which receives and publishes events.
A process that computes and applies updates for a local population of agents.
An interface to a Redis instance or cluster.
This trait's implementation defines the main logic of a simulation.
The state that represents an
An message that agents can queue for themselves or for others.
Convenience function for running a simulation/manager with
Convenience function to run a node of n workers. This blocks until the workers are done.