alogos.systems._shared.representation¶
Shared representations serving as base classes for all systems.
Classes¶
Base genotype for all systems to define a shared structure. |
|
Base individual for all systems to define a shared structure. |
|
Base population for all systems to define a shared structure. |
Detailed object descriptions¶
- class alogos.systems._shared.representation.BaseGenotype[source]¶
Base genotype for all systems to define a shared structure.
- class alogos.systems._shared.representation.BaseIndividual(genotype=None, phenotype=None, fitness=float('nan'), details=None)[source]¶
Base individual for all systems to define a shared structure.
- __init__(self, genotype=None, phenotype=None, fitness=float('nan'), details=None)[source]¶
Create an individual as simple container for genotype, phenotype and fitness.
- less_than(self, other, objective)[source]¶
Determine if the fitness of this individual is less than that of another.
- Parameters:
other (
Individual)objective (
str) – Possible values:"min"for a minimization problem"max"for a maximization problem
It determines how
NaNvalues are treated in the comparsion.
Notes
There is a conceptual problem with
NaNvalues, making the comparison depending on the type of optimization problem being tackled. In case of a minimization problem, any validfloatnumber should be considered to be smaller thanNaN, so that the individuals withNaNfitnesses loose in comparisons. In case of a maximization problem, it is the other way around. Therefore this explicit method with the argumentobjectiveis provided instead of the special method__lt__that would allow individuals to be compared with the<operator but without any arguments.References
- greater_than(self, other, objective)[source]¶
Determine if the fitness of this individual is greater than that of another.
- Parameters:
other (
Individual)objective (
str) – Possible values:"min"for a minimization problem"max"for a maximization problem
It determines how
NaNvalues are treated in the comparsion.
Notes
There is a conceptual problem with
NaNvalues, making the comparison depending on the type of optimization problem being tackled. In case of a minimization problem, any validfloatnumber should be considered to be smaller thanNaN, so that the individuals withNaNfitnesses loose in comparisons. In case of a maximization problem, it is the other way around. Therefore this explicit method with the argumentobjectiveis provided instead of the special method__gt__that would allow individuals to be compared with the>operator but without any arguments.References
- class alogos.systems._shared.representation.BasePopulation(individuals)[source]¶
Base population for all systems to define a shared structure.
- property num_unique_genotypes(self)¶
Get the number of unique genotypes in this population.
- property num_unique_phenotypes(self)¶
Get the number of unique phenotypes in this population.
- property num_unique_fitnesses(self)¶
Get the number of unique fitness values in this population.