Skip to content
Proyectos

flatland-association/flatland-rl has 78 GitHub stars and 22 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-16 21:16 UTC. Last push 2026-11-13.

Cómo se miden estas cifras

Crecimiento de estrellas medido

in 24h
0
in 7 days
Actualización retrasada
in 15 days
Actualización retrasada
in 1 month
Actualización retrasada

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

Acerca de

The Flatland Framework is a multi-purpose environment to tackle problems around resilient resource allocation under uncertainty. It is designed to be a flexible and method agnostic to solve a wide range of problems in the field of operations research and reinforcement learning.

Aprendizaje automático

README.md

Original

🚂 Flatland

Flatland

Main

Flatland is an open-source toolkit for developing and comparing Multi-Agent Reinforcement Learning algorithms in little (or ridiculously large!) gridworlds.

The official documentation contains full details about the environment and problem statement.

Flatland is tested with Python 3.11, 3.12, 3.13 and 3.14 on modern versions of macOS, Linux and Windows. You may encounter problems with graphical rendering if you use WSL.

🏆 Challenges

This library was developed specifically for the AIcrowd Flatland challenges in which we strongly encourage you to take part in!

📦 Setup

Setup virtual environment

Set up a virtual environment using your preferred method (we suggest the built-in venv) and activate it. You can use your IDE to do this or by using the command line:

python -m venv .venv
source .venv/bin/activate

Stable release

Install Flatland using pip:

python -m pip install flatland-rl

This is the preferred method to install Flatland, as it will always install the most recent stable release.

Cython-accelerated build

A few hot-path modules are compiled with Cython for extra performance automatically, as part of the normal install above, whenever a working C compiler is available - no extra flags needed. Cython itself doesn't need to be installed manually either: it's a [build-system] requires entry in pyproject.toml, so pip provisions it automatically as part of the build.

Requirement: a working C compiler (e.g. gcc/clang on Linux/macOS, or the Microsoft C++ Build Tools on Windows). Compilation is optional and best-effort: if a compiler is missing, the build falls back to the plain-Python sources instead of failing, printing a warning for each module it could not compile. Pass -v to pip (python -m pip install -v flatland-rl) to see it - by default pip hides the underlying build output on success. The install still succeeds either way - you get the plain-Python modules, just without the Cython speed-up.

Forcing a plain-Python build: there's no dedicated flag for this - make the build think no C compiler is available instead, the same mechanism this repo's own CI relies on to test the fallback path:

CC=/nonexistent-cc CXX=/nonexistent-cxx python -m pip install flatland-rl

(or CC=/nonexistent-cc CXX=/nonexistent-cxx pip install -e . from a checkout). This produces the same per-module warning output as a genuinely missing compiler - expected and harmless, the install still succeeds as pure-Python.

Only a source distribution (sdist) is published to PyPI - there's no prebuilt wheel - so this always builds from source on your own machine. That's deliberate: a wheel with a Cython extension gets tagged to one specific Python version/platform/ABI the moment Cython even attempts to compile it, regardless of whether the compile actually succeeds - publishing one would mean every other Python version or OS gets no matching wheel at all. Building from source sidesteps that, at the cost of needing Python's standard packaging tools, and failing outright in environments that categorically refuse to build from source (e.g. pip install --only-binary=:all:, some locked-down/air-gapped setups).

Known issue: architecture-mismatched Cython extensions on Apple Silicon

Symptoms: on some x86_64-conda-on-Apple-Silicon setups (Python running under Rosetta 2), importing flatland-rl raises something like:

ImportError: dlopen(.../flatland/envs/step_utils/states.cpython-312-darwin.so, ...):
tried: '...states.cpython-312-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

even though pip install itself reports success.

Diagnosis: one or more of the Cython-accelerated modules (flatland.envs.step_utils.states, .state_machine, flatland.envs.rail_env_shortest_paths) got compiled for the host chip's native architecture (arm64) instead of the target Python's architecture (x86_64), so it fails to load.

conda info | grep platform                                    # installed conda platform (can be in mismatch with host arch): osx-64/osx-arm64
python -c "import platform; print(platform.machine())"        # arch of python on $PATH: x86_64/arm64
file "$(which python)"                                        # arch of python binary on $PATH: x86_64/arm64
uname -m                                                      # host arch (can be in mismatch with installed conda platform): arm64/x86_64

Known workarounds:

🚀 Releases

👥 Credits

This library was initially developed by SBB, Deutsche Bahn, SNCF, AIcrowd and numerous contributors from the flatland community. It is now developed by the Flatland Association and the Flatland Community.

➕ Contributions

Please follow the Contribution Guidelines for more details on how you can successfully contribute to the project. We enthusiastically look forward to your contributions!

💬 Communication

🔗 Partners

SBB   DB   SNCF   AIcrowd   Flatland Community