_population

Module Contents

Classes

Population

Generic SQLAlchemy model for a population.

Attributes

TIndividual

TIndividual
class Population

Bases: experimentation.database.HasId, sqlalchemy.orm.MappedAsDataclass, Generic[TIndividual]

Inheritance diagram of experimentation.optimization.ea._population.Population

Generic SQLAlchemy model for a population.

Inherit from this to create your own population type.

The generic parameter TIndividual refers to the user-defined individual type. This parameter cannot be a forward reference.

For example:

class MyPopulation(Base, Population[MyIndividual]):
    __tablename__ = "my_population"
classmethod __init_subclass__(/, **kwargs: dict[str, Any]) None

Initialize a version of this class when it is subclassed.

Gets the actual type of TIndividual and stores it for later use.

Parameters:

kwargs – Remaining arguments passed to super.