geneticengine.solutions.individual

Attributes

G

P

Exceptions

IndividualNotEvaluatedException

Common base class for all non-exit exceptions.

Classes

Individual

Helper class that provides a standard way to create an ABC using

ConcreteIndividual

Helper class that provides a standard way to create an ABC using

PhenotypicIndividual

Helper class that provides a standard way to create an ABC using

Module Contents

geneticengine.solutions.individual.G
geneticengine.solutions.individual.P
exception geneticengine.solutions.individual.IndividualNotEvaluatedException

Bases: Exception

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

class geneticengine.solutions.individual.Individual(metadata=None)

Bases: Generic[P], abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

Parameters:

metadata (dict[str, Any] | None)

fitness_store: weakref.WeakKeyDictionary[geneticengine.problems.Problem, geneticengine.problems.Fitness]
metadata: dict[str, Any]
abstractmethod get_phenotype()
Return type:

P

has_fitness(problem)
Parameters:

problem (geneticengine.problems.Problem)

Return type:

bool

set_fitness(problem, fitness)
Parameters:
get_fitness(problem=None)
Parameters:

problem (geneticengine.problems.Problem | None)

Return type:

geneticengine.problems.Fitness

class geneticengine.solutions.individual.ConcreteIndividual(instance, metadata=None)

Bases: Generic[P], Individual[P]

Helper class that provides a standard way to create an ABC using inheritance.

Parameters:
  • instance (P)

  • metadata (dict[str, Any] | None)

instance: P
get_phenotype()
class geneticengine.solutions.individual.PhenotypicIndividual(genotype, representation, metadata=None)

Bases: Generic[G, P], Individual[P]

Helper class that provides a standard way to create an ABC using inheritance.

Parameters:
genotype: G
representation: geneticengine.representations.api.Representation[G, P]
phenotype: P | None = None
get_phenotype()
__str__()
Return type:

str