Skip to main content

Multi-agent RL flock and swarm environments implemented in JAX

Project description

Floxs

Swarm and Flock Multi-agent RL environments, implemented with JAX using Esquilax

Full documentation can be found here

Multi-agent RL environments with a focus on larger scale flocks and swarms on continuos spaces. Implemented using Esquilax a JAX multi-agent simulation and RL library, and the Jumanji RL environment API.

from floxs.flock.env import Flock
import jax


env = Flock()

key = jax.random.PRNGKey(101)
state, ts = env.reset(key)
states = [state]

for _ in range(100):
    key, k = jax.random.split(key)
    actions = jax.random.uniform(k, (env.generator.num_boids, 2), minval=0.5, maxval=1.0)
    state, ts = env.step(state, actions)
    states.append(state)

# Save an animation of the environment
env.animate(states, interval=100, save_path="animation.gif")

See the Jumanji docs for more usage information.

Usage

Floxs can be installed using pip

pip install floxs

From the repository the package and requirements can be installed using poetry by running

poetry install

Developers

Pre-Commit Hooks

Pre commit hooks can be installed by running

pre-commit install

Pre-commit checks can then be run using

task lint

Tests

Tests can be run with

task test

Build Documentation

Docs can be built using Sphinx by running

task docs

Built docs will be generated in the docs/build folder.

Project details


Download files

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

Source Distribution

floxs-0.1.1.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

floxs-0.1.1-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file floxs-0.1.1.tar.gz.

File metadata

  • Download URL: floxs-0.1.1.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.11

File hashes

Hashes for floxs-0.1.1.tar.gz
Algorithm Hash digest
SHA256 49391aba4d9ac8916c0ac1b976f82e4d7af700b8af8ccb4d737ff948ee48e942
MD5 4aa1573c7451e966752f1fb7e5359f1e
BLAKE2b-256 6b0ddda5c816adf5b6c32e33497bbdb62c1f2fd48af622ecefb0c913dade6603

See more details on using hashes here.

File details

Details for the file floxs-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: floxs-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.11

File hashes

Hashes for floxs-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f69e7863c7146c6e3332ad19b693cc23c61603f74f4938a5e5512cb2abcbbadf
MD5 09674bf02f1111f78dc940c73ea50f75
BLAKE2b-256 aa6f63eac88731276d22ad2aad02f4ed5cf9fc666627c33461e4bcfde4a17cc2

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