Skip to main content

Framework for stock-flow consistent agent-based modeling, being developed at the German Aerospace Center (DLR) for and in the scientific context of energy systems analysis, however, it is widely applicable in other scientific fields.

Project description

sfctools - A toolbox for stock-flow consistent, agent-based models

Sfctools is a lightweight and easy-to-use Python framework for agent-based macroeconomic, stock-flow consistent (ABM-SFC) modeling. It concentrates on agents in economics and helps you to construct agents, helps you to manage and document your model parameters, assures stock-flow consistency, and facilitates basic economic data structures (such as the balance sheet). For more documentation, see https://sfctools-framework.readthedocs.io/en/latest/.

Installation

We recommend to install sfctools in a fresh Python 3.8 environment. For example, with conda, do

conda create --name sfcenv python=3.8
conda activate sfcenv
conda install pip

Then, in a terminal of your choice, type:

pip install sfctools

see https://pypi.org/project/sfctools/

Usage with Graphical User Interface 'Attune'

Type

python -m sfctools attune

to start the GUI.

Usage inside Python

Try out this simple example:

from sfctools import Agent, World 

class SomeAgent(Agent):
    def __init__(self, a):
        super().__init__()
        self.some_attribute = a

my_agent = SomeAgent(a='Hello')
your_agent = SomeAgent(a='World')

my_agents = World().get_agents_of_type("SomeAgent")
my_message = my_agents[0].some_attribute
your_message = my_agents[1].some_attribute

print("%s says %s, %s says %s" % (my_agent, my_message, your_agent, your_message))

The resulting output will be

SomeAgent__00001 says Hello, SomeAgent__00002 says World

More Examples

Have a look at the documentation page for more examples.

Cite this Software

You can cite the software as follows:

Baldauf, T., (2023). sfctools - A toolbox for stock-flow consistent, agent-based models. Journal of Open Source Software, 8(87), 4980, https://doi.org/10.21105/joss.04980

You can cite the software repository as follows:

Thomas Baldauf. (2023). sfctools - A toolbox for stock-flow consistent, agent-based models (1.1.0.2b). Zenodo. https://doi.org/10.5281/zenodo.8118870


| Corresponding author: Thomas Baldauf, German Aerospace Center (DLR), Curiestr. 4 70563 Stuttgart | thomas.baldauf@dlr.de |

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sfctools-1.1.9.0.tar.gz (703.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sfctools-1.1.9.0-py3-none-any.whl (357.0 kB view details)

Uploaded Python 3

File details

Details for the file sfctools-1.1.9.0.tar.gz.

File metadata

  • Download URL: sfctools-1.1.9.0.tar.gz
  • Upload date:
  • Size: 703.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.8.17 Windows/10

File hashes

Hashes for sfctools-1.1.9.0.tar.gz
Algorithm Hash digest
SHA256 031cfd5a8ed4001b2cb921addc37069ceac144230243176d7e63d79d99158a5c
MD5 a3dc56b2737d93e1a41d49038edfedcb
BLAKE2b-256 f509be991a947ef116cd082d9afb7f9c71a8b77900be5424f22383e08477b596

See more details on using hashes here.

File details

Details for the file sfctools-1.1.9.0-py3-none-any.whl.

File metadata

  • Download URL: sfctools-1.1.9.0-py3-none-any.whl
  • Upload date:
  • Size: 357.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.8.17 Windows/10

File hashes

Hashes for sfctools-1.1.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ea46db7d9125d2e78fd6d03fd4e5ff1f7c197fd3b0c48a39d0ee5c7d07e3fe8
MD5 c4bc04a0a3d8491d0f4f0ee1171ea539
BLAKE2b-256 cb95998ae90e5b317027a325ba9dc66c32427b4b3bdae8b6fbd8621dd5835b0e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page