gaft.plugin_interfaces.operators¶
Module for Genetic Algorithm selection operator class
-
class
gaft.plugin_interfaces.operators.selection.
Selection
¶ Bases:
object
Class for providing an interface to easily extend the behavior of selection operation.
-
select
(population, fitness)¶ Called when we need to select parents from a population to later breeding.
Parameters: population (gaft.compoenents.Population) – The current population Return parents: Two selected individuals for crossover
-
Module for Genetic Algorithm crossover operator class
-
class
gaft.plugin_interfaces.operators.crossover.
Crossover
¶ Bases:
object
Class for providing an interface to easily extend the behavior of crossover operation between two individuals for children breeding.
Attributes:
pc(float
): The probability of crossover (usaully between 0.25 ~ 1.0)-
cross
(father, mother)¶ Called when we need to cross parents to generate children.
Parameters: - father (gaft.components.IndividualBase) – The parent individual to be crossed
- mother (gaft.components.IndividualBase) – The parent individual to be crossed
Return children: Two new children individuals
-
Module for Genetic Algorithm mutation operator class
-
class
gaft.plugin_interfaces.operators.mutation.
Mutation
¶ Bases:
object
Class for providing an interface to easily extend the behavior of selection operation.
Attributes:
pm(float): Default mutation probability, default is 0.1-
mutate
(individual, engine)¶ Called when an individual to be mutated.
Parameters: - individual (gaft.components.IndividualBase) – The individual to be mutated
- engine (gaft.engine.GAEngine) – The GA engine where the mutation operator belongs.
-