Start with installing uv, uv is a modern python package manager.
Using brew:
brew install uvuv run main.py <CLI_ARGS>The simulation can be configured using a variety of command-line arguments. If no arguments are provided, the simulation will run with a default set of parameters.
| Argument | Default | Description |
|---|---|---|
--gui |
False |
Launches the graphical user interface to visualize the simulation. If omitted, the simulation runs in the command line and outputs a JSON blob. |
--turns |
100 |
Sets the total number of days the garden gets to cultivate. |
--count |
20 |
Sets the number of plants (only works with the --random flag). |
--json_path |
No default |
Specify the seed and plant variations of a simulation. |
--seed |
No default |
Provides a seed for the random number generator to ensure reproducible simulations. |
The --gardener argument allows you to specify the gardener which will cultivate the garden
- Format:
--gardener <TYPE> <TYPE>: A short code representing the player type.
| Code | Gardener Type |
|---|---|
gr |
RandomGardener |
g1-g10 |
Gardener1 through Gardener10 |
The repository uses Ruff for both formatting and linting, if your PR does not pass the CI checks it won't be merged.
VSCode has a Ruff extension that can run on save. Editor Setup.
To run formatting check:
uv run ruff format --checkTo run formatting:
uv run ruff formatTo run linting:
uv run ruff checkTo run linting with auto-fix:
uv run ruff check --fixHere are some common examples of how to run the simulation with different configurations.
To run the simulation and see the visualizer, use the --gui flag. This example also increases the number of turns using the RandomGardener.
uv run python main.py --random --gui --turns 200 --gardener grTo create a simulation using the JSON file, and increase the number of turns in the simulation. No GUI.
uv run python main.py --json_path /path/to/my.json --turns 200 --gardener gr