A python package for asynchronous genetic algorithms.
If a chromosome's fitness is repeatedly estimateable, but its exact value cannot be computed, or if a chromosome is changing over time, then AsyncGA will be able to concurrently update the estimate of the chromosome's fitness while evolving.
For usage, see help(async_ga.AsyncGA)
.
For the example documentation, see help(async_ga.DefaultGA)
.
from async_ga import DefaultGA
import asyncio
async def get_best_chromosome():
ga = DefaultGA()
async for population in ga.evolve():
print(population[0].fitness.mean)
return population[0]
chromosome = asyncio.run(get_best_chromosome())
print(chromosome)