Distributed GA
DistributedGA - also known as the island genetic algorithm (dGA).
V - value of Chromosome
F - fitness value of Chromosome
DistributedGA is an algorithm that divides a large population into subpopulations and runs the genetic algorithm on each subpopulation independently. Kgal
offers a broader and more universal definition for a DistributedGA: dGA is an algorithm that controls the evolutionary processes of child genetic algorithms (children).
The launched evolutionary processes of child GAs are calculated independently of each other, which allows for efficient and safe use of parallelism
: set the value ParallelismConfig.workersCount equal to the number of child GAs (children.size
), this will allow children to be launched on separate parallel coroutines that achieves almost linear speedup compared to the classical version of the genetic algorithm.
dGA(...) {
parallelismConfig {
// distributed parallelism:
// run each child GA independently in their own coroutine!
workersCount = DISTRIBUTED_GA_COUNT
}
}
The most popular type for DistributedGA is the island GA model, island evolutionary strategy
includes:
launching child genetic algorithms (including parallel mode)
default
synchronization of genetic algorithms (waiting for all to complete)
default
checking stop conditions (
NOTE
don't forget to set a limit on the number of iterations withstopBy(DISTRIBUTED_MAX_ITERATION)
, otherwise the evolution will happen endlessly)using genetic operators to interact between populations (for example: migration)
The first two steps are automated by kgal
in the default
behavior of the function DistributedConfigScope.evolve, so the island evolutionary strategy
can be specified as:
evolve {
// maxIteration stop condition is necessary!
stopBy(maxIteration = DISTRIBUTED_MAX_ITERATION)
migration(percent = 0.1)
}
DistributedGA supports Shared statistics
, see statisticsProvider.
Creates with Kotlin DSL by dGA.
See also
Properties
Creates SessionsInfo that describes all activity of GA.
The best Chromosome in Population by fitness.
The best fitness of Chromosome in Population.
Fitness function - a function that evaluates the quality or "fitness" of each individual (chromosome) in a population. The fitness function determines how well a particular solution matches the target problem. It can be changed.
The DistributedGA does not have its own population, but kgal
defines this property as the total population of all subpopulations of child GAs (children).
Shared statistics
: DistributedGA is collector for each child statistics - statistics of DistributedGA includes all statistics of children:
Store for all TimeMarkers of GA.
The worst Chromosome in Population by fitness.
The worst fitness of Chromosome in Population.
Functions
Unsubscribe and clear all collectors for StatisticsProvider.
Unsubscribe and remove collector by id.
Start GA with runBlocking, non suspend function.
Stop genetic algorithm.