Skip to content

Datadynamics

pypi Test Status Documentation Status code style: black Imports: isort pre-commit License

Datadynamics is a Python library and environment for simulating (multi-agent) data collection dynamics. The library is built on top of PettingZoo and is distributed under the BSD 3-Clause License.

The documentation is available at lfwa.github.io/datadynamics/.

Installation

Datadynamics can be installed via PyPI from Python 3.10 and higher:

$ pip install datadynamics

Alternatively, you can install from source by downloading the latest release or by cloning the GitHub repository, navigating into the directory, and installing via Poetry: poetry install.

Usage

Visit the documentation site at lfwa.github.io/datadynamics/ for full usage guides.

Quick Start

# See tutorials/collector/wrapper_example.py
from datadynamics.environments import collector_v0
from datadynamics.policies import greedy_policy_v0

env = collector_v0.env(
    n_points=300, n_agents=2, max_collect=[120, 180], render_mode="human"
)
policy = greedy_policy_v0.policy(env=env)
env.reset()
for agent in env.agent_iter():
    observation, reward, termination, truncation, info = env.last()
    action = policy.action(observation, agent)
    env.step(action)