Skip to content

Configuration

Dan Riddell edited this page Aug 5, 2026 · 1 revision

Configuration

The population and size flags (--plants, --herbivores, --carnivores, --width, --height, --rescue, --seed) cover the basics. The ecological, metabolic and learning scalars are exposed as a JSON config so a run can be tuned without recompiling.

Generating a template

go run ./cmd/vivarium headless --print-config > myconfig.json

--print-config is on the headless subcommand because it is display-free — you can generate a template on a machine with no GPU or X server.

Using it

go run ./cmd/vivarium --config myconfig.json

Partial configs

Config files may be partial. Any field you leave out keeps its default, so a config that changes one scalar need only contain that scalar:

{
  "plants": 400
}

The full default is committed at docs/config.example.json.

Precedence

Flags override the config file, which overrides the built-in defaults:

built-in defaults  <  --config file  <  explicit flags

So this runs myconfig.json but forces a different seed and plant count:

go run ./cmd/vivarium --config myconfig.json --seed 7 --plants 500

Clone this wiki locally