Dsxir. Optimizer. GEPA. Population
(dsxir v0.3.0)
Copy Markdown
Opaque collection of %Individual{} preserving birth order. Lookup by id is
O(1); iteration is birth-order stable (oldest first).
Summary
Functions
Appends ind to the population. No-op when ind.id already exists.
Looks up an individual by id. Returns nil if unknown.
Creates a new population seeded with a single individual.
Number of individuals in the population.
Returns members in birth order (oldest first).
Types
@type id() :: Dsxir.Optimizer.GEPA.Individual.id()
@type t() :: %Dsxir.Optimizer.GEPA.Population{ by_id: %{required(id()) => Dsxir.Optimizer.GEPA.Individual.t()}, order: [id()] }
Functions
@spec add(t(), Dsxir.Optimizer.GEPA.Individual.t()) :: t()
Appends ind to the population. No-op when ind.id already exists.
@spec by_id(t(), id()) :: Dsxir.Optimizer.GEPA.Individual.t() | nil
Looks up an individual by id. Returns nil if unknown.
@spec new(Dsxir.Optimizer.GEPA.Individual.t()) :: t()
Creates a new population seeded with a single individual.
@spec size(t()) :: non_neg_integer()
Number of individuals in the population.
@spec to_list(t()) :: [Dsxir.Optimizer.GEPA.Individual.t()]
Returns members in birth order (oldest first).