Module genetic
source code
This module contains a basic framework for a genetic algorithm. This
specific implentation specifically keeps high selective pressure on the
population by always keeping the best individuals found. The algorithm
checks to make sure that no individual is tested twice.
Chromozomes are constructed from "Variable" classes that
govern rondom generation and recombination of each element in the
chromozome. For example if your fitness function requires a number from
one to ten you could uses a ChoiceVariable with choices =
[1,2,3,4,5,6,7,8,9,10].
TODO: Add a tutorial.
This class also has some examples in the unit tests.
|
|
|
|
|
|
|
|
|
_gaWork(data)
This is a work function that gets called on child processes to
evaluate a fitness function. |
source code
|
|
|
_GA_EVALUATE = ' GA_EVALUATE '
|
|
_GA_STOP_WORKER = ' GA_STOP_WORKER '
|
|
_GA_SCORE = ' GA_SCORE '
|
|
__package__ = ' pyvision.optimize '
|