Typed config validation for Petri.run/2.
Uses Zoi to validate the config map
against a typed schema. Invalid configs return {:error, reasons}.
Encoding-specific schemas
The schema is a discriminated union on :encoding. Fields shared across
all encodings live in a common base; encoding-specific fields (:bounds,
:crossover, :mutation, etc.) are added per variant.
Example
iex> {:ok, config} = Petri.Config.parse(%{
...> encoding: :binary, length: 8,
...> population_size: 20, max_generations: 10
...> })
iex> config.encoding
:binary
iex> {:error, err} = Petri.Config.parse(%{
...> encoding: :binary, length: 8,
...> population_size: 0, max_generations: 10
...> })
iex> is_list(err)
true
Summary
Functions
Parses and validates a map against the config schema.