The project SYNGrid concerns the design and implementation of a lightweight benchmark environment for evaluating Long-Term Credit Assignment in Artificial Intelligence agents. The benchmark is implemented as a grid-based environment in Python and follows the Gymnasium API standard, allowing reinforcement learning agents to interact with the environment in a consistent and reproducible manner.
- Python 3.10 – 3.12
- pip
git clone https://github.com/J-manLans/SynergyGrid.git
cd synergygridpython -m venv .venvActivate it:
- macOS/Linux:
source .venv/bin/activate- Windows:
.venv\Scripts\activateInstall in editable mode with development dependencies:
pip install -e .[dev]Do not run the project without arguments:
python -m synergygridThis will attempt to evaluate a non-existing model and result in an error.
python -m synergygrid --timesteps <T> --iterations <I>This will:
- Train an agent using the default algorithm
- Save model checkpoints during training
- Train the agent for
<T>timesteps<T>should be a multiple of 2048, since each training batch contains 2048 steps
- Train the agent for
<I>iterations
Example:
python -m synergygrid --timesteps 2048 --iterations 10python -m synergygrid --run --steps <N>Replace <N> with the number of steps of a saved model.
Example:
python -m synergygrid --run --steps 20480python -m synergygrid --cont --steps 20480python -m synergygrid --human_controlsPlay the environment manually using keyboard controls.
python -m synergygrid --run --no-agent| Argument | Description |
|---|---|
--alg {0,1,2} |
Select algorithm index |
--run |
Run/evaluate a trained agent (default is training) |
--no-agent |
Use random actions instead of a trained agent |
--cont |
Continue training from a saved model |
--steps <N> |
Model checkpoint to load (required with --run or --cont) |
--timesteps <N> |
Number of timesteps per training iteration |
--iterations <N> |
Number of training iterations |
--human_controls |
Enable manual control |