Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

FleetGym

CI Docs License: MIT Python

Gymnasium and PettingZoo environments for reinforcement learning on vehicle routing problems, with a focus on stochastic and dynamic variants where information arrives during the day.

Status: pre-alpha. The v0.1 core is under construction (see STATUS.md and the implementation plan). APIs will change.

What is there today

  • Problems as data. Each environment is one YAML file: fleet, network, constraints, uncertainty, decisions and objective. Configs can extend each other and be overridden from the command line. Every spec has a stable content hash that is saved with logs and results.
  • A discrete-event simulator with exact get_state / set_state / clone (including RNG state) and an event log of everything that happened.
  • An independent validator that re-checks any episode from its event log, so a simulator bug cannot hide itself.
  • Uncertainty and recourse. Uncertain demands and service times are pre-sampled into a scenario, revealed to the agent when the spec says, and replayed exactly. Capacity failures are handled by standard or user-written recourse rules; fork(seed) gives planners a copy that cannot see the future.
  • Dynamic requests. Requests arrive during the day (Poisson or time-of-day rates), can cancel, and are accepted, rejected, outsourced or assigned by the agent while a built-in routing rule drives the vehicles.
  • Verified against benchmarks. CVRP-v0 reproduces all 100 CVRPLIB X best-known solutions exactly; VRPTW-v0 reproduces all 56 Solomon (100-customer) best-known solutions from SINTEF.
Environment Status
CVRP-v0 stable
VRPTW-v0 stable
DVRP-StochReq-v0 experimental (requests arriving during the day, accept/reject)
VRPSD-v0 experimental (stochastic demands, return-to-depot recourse)
VRPSD-Outsource-v0 planned (stochastic demands with outsourcing)
MA-CVRP-v0, MA-DVRP-v0 experimental (multi-agent, PettingZoo: one agent per vehicle)

Quick start

import fleetgym as fg

env = fg.make("CVRP-v0")
obs, info = env.reset(seed=0)
done = False
while not done:
    action = env.action_space.sample(mask=env.action_masks().astype("int8"))
    obs, reward, terminated, truncated, info = env.step(action)
    done = terminated or truncated

Command line:

fleetgym list                       # registered environments
fleetgym show VRPTW-v0              # the resolved config
fleetgym validate my-config.yaml    # check a config
fleetgym replicate CVRP-v0          # replay published best-known solutions (downloads data)

Train and evaluate

pip install "fleetgym[sb3]"
fleetgym train CVRP-v0 --algo maskable_ppo --policy gat --steps 100000 --out runs/cvrp
fleetgym eval CVRP-v0 --model runs/cvrp --episodes 32 --reference nearest --out runs/cvrp/report.json

Render an episode (map and vehicle Gantt chart) with fleetgym render DVRP-StochReq-v0 --out day.png or render_mode="rgb_array" (needs fleetgym[viz]).

Baselines (random, nearest neighbor, cheapest insertion, rollout, PyVRP re-optimization and a perfect-information benchmark) run through the same evaluation harness, on fixed test scenarios.

Documentation and examples

The documentation (source in docs/site) covers the concepts, every environment, and a step-by-step guide to building your own VRP variant. The examples/ folder has runnable scripts, from a first environment to a custom variant, training and multi-agent routing.

Install (development)

git clone https://github.com/moda707/fleetgym.git
cd fleetgym
uv sync --extra dev
uv run pytest

Requires Python 3.12 or later. Optional extras: sb3, gnn, solvers, viz, all. See CONTRIBUTING.md for the development workflow.

Benchmark data

Benchmark instances and best-known solutions are not stored in this repository. They are downloaded on request from their publishers (CVRPLIB, SINTEF TOP), checked against SHA-256 checksums, and cached under $FLEETGYM_DATA_DIR (default ~/.cache/fleetgym).

Citing

If you use FleetGym in your research, please cite it. GitHub's "Cite this repository" button and CITATION.cff give the citation; a Zenodo DOI will be added with the first release.

License

MIT. See LICENSE.

Metadata

Release files for fleetgym 0.1.0a1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fleetgym 0.1.0a1
File Size Uploaded Provenance Actions
fleetgym-0.1.0a1.tar.gz 343.7 kB With provenance Details for fleetgym-0.1.0a1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fleetgym 0.1.0a1
File Interpreter ABI Platform Actions
fleetgym-0.1.0a1-py3-none-any.whl Python 3 none any Details for fleetgym-0.1.0a1-py3-none-any.whl

Total release size: 588.6 kB

Release files / fleetgym-0.1.0a1.tar.gz

Download URL fleetgym-0.1.0a1.tar.gz
Size 343.7 kB
Tags Source
SHA-256 checksum
How to use checksums
61c94caab71d4ef1a30fbfaa2952e88bf2192b9d3713d268615d507c39fa01dd
BLAKE2b-256 checksum
How to use checksums
928c5afacea20b01489915e6a9d1f747ac13a9b471f9eba57e178a59b82dd13f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / fleetgym-0.1.0a1-py3-none-any.whl

Download URL fleetgym-0.1.0a1-py3-none-any.whl
Size 244.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79859e9e88b0c859a0295d286797fccd6995e1aaaf218210cf90cfe15cefd3de
BLAKE2b-256 checksum
How to use checksums
a9867e990a59bfbdad052cdd59dbdc439a796cf0c80d2a5e1d5761e145364261
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for fleetgym 0.1.0a1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for fleetgym-0.1.0a1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page