Skip to content

LinnartSF/abm_framework

Folders and files

Name Name
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FRAMEWORK.PY, STATS.PY, DATA.PY, and ANIMATION.PY are not available in this open repository anymore. Instead, you can download the updated and professionally maintained repository here: SCDA abm_framework

abm_framework

SCDA - Supply Chain Data Analytics

A framework for agent-based simulation. It covers grid-based simulations. This model is part of SCDA.

The model supports grid-based simulations and includes visualization and animation functionality. The module is continously extended to cover additional functionality. For example, I added the Moore neighbourhood as a neighbourhood option for grid-based ABM simulations. In a second step, the Neumann neighbourhood (easy addition) can be added, and then in addition other neighbourhood types as required.

abm framework module content

Database directory contains sqlite3 database file that is meant for storing simulation results into database.

The data.py module provides functionality for executing queries in the database. data.py comprises a Database class and a Manager class. Database class facilitates connection to sqlite3 and potentially also mssql database. Manager class provides methods representing standardized queries for quickly implementing operations on the database that are of relevance to the ABM simulations supported by this package.

framework.py contains classes for modelling e.g. the simulation environment and the agents themselves.

stats.py provides visualization capabilities for visualizing simulation results.

config.py is a configuration file that e.g. allows for path adjustments or input parameter adjustments. It e.g. specifies the filepath of the sqlite3 database used to store simulation results.

animation.py provides animation capabilities for animating simulation results and their trajectory throughout time.

references to related articles covering abm modeling

I gave some basic introductions covering the differences between simulation methods as well as basic agent-based simulation modeling in Python - and you can find these introductions on my blog:

introduction to agent-based simulation

Agent-based simulation is a methodology that applies compulation models for simulating interactions between autonomous agents as well as their actions. It can be combined with other simulation methodes, e.g. with monte-carlo simulation methodology for consideration of stochasticity. But it can e.g. also be combined with discrete-event simulation methodology. For example, processes "going on" inside agents can be modelled and simulated with discrete-event simulation. Below is an overview and comparison of the main simulation methodes.

Simulation method comparison

Agent-based simulation models are simulation models that focus that describe microscopic interactions between agents. By adding, removing, and manipulating these microscopic interactions, changes to macroscopic system behaviour are analyzed. ABM is applied to understand the emergence of complex macropic phenomena.

Agent attributes and interactions

Agents have attributes and the interactions between agents are described by logics and strategies. This framework provides a toolkit for building agent-based models. It also provides pre-defined database structures and visualization as well as animation functionality. You can use this to implment your own agent-based simulation. Demo models are provided in the demos folder.

agent-based modeling applications

Agent-based simulation models are applied in many different areas. This includes the domains listed below:

  1. Biology
  2. Epidemology
  3. Business
  4. Technology
  5. Network technology
  6. Social sciences
  7. Economics
  8. Autonomous driving

This repository comprises a demos folder. In there you will find, dynamically added over time, a series of simulation examples.

exemplary visualizations created with abm_framework

This framework supports standardized agent-based simulation animations and visualizations. The scope of animation and visualization templates is dynamically expanded overtime, but initially comprises at least:

  • agent attribute value trajectories for all agents individually, a specific subset of agents, or all agents on average
  • average attribute value distribution over time, for a specific population of agents and a list of relevant agent attributes
  • grid location plots and animations for all agents or a set of agent population groups
  • attribute value density distribution across the grid, in the form of plots and animations, for specified attributes

You can see some exmaples below:

Segregation process animation

Segregation process and utility concentration

Avg agent attribute value trajectory

Agent attribute value trajectories

Agent grid locations

Attribute density animation

Attribute density animation

Attribute density animation

About

A framework for agent-based simulation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages