Migration Operators

Submodules

pygenalgo.operators.migration.clockwise_migration module

class pygenalgo.operators.migration.clockwise_migration.ClockwiseMigration(migration_probability: float = 0.95)[source]

Bases: MigrationOperator

Description:

Clockwise Migration implements a “very basic” migration policy in which each island migrates its best chromosome to the population on its right, following a “clockwise” rotation movement.

migrate(islands: list[SubPopulation]) None[source]

Perform the migration operation on the list of SubPopulations.

Parameters:

islands – list[SubPopulation].

Returns:

None.

pygenalgo.operators.migration.meta_migration module

class pygenalgo.operators.migration.meta_migration.MetaMigration(migration_probability: float = 0.95)[source]

Bases: MigrationOperator

Description:

Meta-migrator, performs the migration between the subpopulations by applying randomly all other migrators (one at a time), with equal probability.

NOTE: In the future the equal probabilities can be amended.

property all_counters: dict

Accessor (getter) of the application counter from all the internal migrators. This is mostly to verify that everything is working as expected.

Returns:

a dictionary with the counter calls for all migrator methods.

migrate(islands: list[SubPopulation]) None[source]

Perform the migration operation on the list of SubPopulations.

Parameters:

islands – list[SubPopulation].

Returns:

None.

reset_counter() None[source]

Sets ALL the counters to ‘zero’. We have to override the super().reset_counter() method, because we have to call explicitly the reset_counter on all the internal operators.

Returns:

None.

pygenalgo.operators.migration.migration_operator module

class pygenalgo.operators.migration.migration_operator.MigrationOperator(migration_probability: float)[source]

Bases: GeneticOperator

Description:

Provides the base class (interface) for a Migration Operator.

migrate(islands: list[SubPopulation]) None[source]

Abstract method that “reminds” the user that if they want to create a Migration Class that inherits from here they should implement a migrate method.

Parameters:

islands – list[SubPopulation].

Returns:

Nothing but raising an error.

pygenalgo.operators.migration.random_migration module

class pygenalgo.operators.migration.random_migration.RandomMigration(migration_probability: float = 0.95)[source]

Bases: MigrationOperator

Description:

Random Migration implements a “very basic” migration policy in which each island migrates its best chromosome to a randomly selected population.

migrate(islands: list[SubPopulation]) None[source]

Perform the migration operation on the list of SubPopulations.

Parameters:

islands – list[SubPopulation].

Returns:

None.

Module contents