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

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

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.0.tar.gz (15.9 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.0-py3-none-any.whl (21.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: floxs-0.1.0.tar.gz
  • Upload date:
  • Size: 15.9 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.0.tar.gz
Algorithm Hash digest
SHA256 04ad008c6ca5c5e297ca07bb6bd68d03d2744b6214fbc6037eb5e70cd3e74fe9
MD5 5e3ec3012e580caedcfc03c8d37ab84c
BLAKE2b-256 e0e874209b01d9c71db06c44c58387b266a9f41c74cf1353d80c9aebdab55d8a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: floxs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 06afed73b86325ef004eb4926e43b1030c5b87a65e3777158f1d9457f98a29e1
MD5 1604fedd83f867d51df91740ebe546c1
BLAKE2b-256 0c429daaa69bf8180595832e0acd1f58b53677f759aab82c5b90954a3d028cc6

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