Operators
Subpackages
- Crossover Operators
- Submodules
- pygenalgo.operators.crossover.crossover_operator module
- pygenalgo.operators.crossover.meta_crossover module
- pygenalgo.operators.crossover.multi_point_crossover module
- pygenalgo.operators.crossover.order_crossover module
- pygenalgo.operators.crossover.partially_mapped_crossover module
- pygenalgo.operators.crossover.position_based_crossover module
- pygenalgo.operators.crossover.single_point_crossover module
- pygenalgo.operators.crossover.uniform_crossover module
- pygenalgo.operators.crossover.blend_crossover module
- Module contents
- Migration Operators
- Mutation Operators
- Submodules
- pygenalgo.operators.mutation.flip_mutator module
- pygenalgo.operators.mutation.gaussian_mutator module
- pygenalgo.operators.mutation.inverse_mutator module
- pygenalgo.operators.mutation.meta_mutator module
- pygenalgo.operators.mutation.mutate_operator module
- pygenalgo.operators.mutation.random_mutator module
- pygenalgo.operators.mutation.shuffle_mutator module
- pygenalgo.operators.mutation.swap_mutator module
- pygenalgo.operators.mutation.polynomial_mutator module
- Module contents
- Selection operators
- Submodules
- pygenalgo.operators.selection.boltzmann_selector module
- pygenalgo.operators.selection.linear_rank_selector module
- pygenalgo.operators.selection.random_selector module
- pygenalgo.operators.selection.roulette_wheel_selector module
- pygenalgo.operators.selection.select_operator module
- pygenalgo.operators.selection.stochastic_universal_selector module
- pygenalgo.operators.selection.tournament_selector module
- pygenalgo.operators.selection.truncation_selector module
- pygenalgo.operators.selection.neighborhood_selector module
- pygenalgo.operators.selection.meta_selector module
- Module contents
Submodules
pygenalgo.operators.genetic_operator module
- class pygenalgo.operators.genetic_operator.GeneticOperator(probability: float)[source]
Bases:
objectDescription:
Provides the parent class (interface) for a Genetic Operator. This class includes the common variables, such as the probability and the application counter, along with access to them.
All genetic operators (Selection, Crossover, Mutation, Migration) should inherit this class.
- property counter: int
Accessor (getter) of the application counter.
- Returns:
the int value of the counter variable.
- inc_counter() None[source]
Increase the counter value by one. This is applied after each application of the genetic operator.
- Returns:
None.
- is_operator_applicable() bool[source]
Since to apply a genetic operator we have to check it probabilistically, we set the condition in here so that the objects inheriting from this class can call only this function.
If the genetic probability is higher than a uniformly random value, apply the operator’s changes.
- Returns:
(bool) the output of the: probability > U(0,1).
- property items: Any
Accessor (getter) of the _items container.
- Returns:
_items (if any).
- property iteration: int
Accessor (getter) of the iteration parameter.
- Returns:
the iteration value.
- property probability: float
Accessor (getter) of the probability.
- Returns:
the float value of the probability.
- property rng: Generator
Get access of the Class variable (_rng).
- Returns:
the random number generator.