geneticengine.representations.tree.operators
Classes
All individuals are created with full trees (maximum depth in all |
|
All individuals are created expanding productions until a maximum depth, |
|
All individuals are created expanding productions until a maximum depth, |
|
Half of the individuals are created with the maximum depth, and the |
|
Starts with an initial population, and relies on another initializer if |
Module Contents
- class geneticengine.representations.tree.operators.FullInitializer(max_depth)
Bases:
geneticengine.algorithms.gp.structure.PopulationInitializerAll individuals are created with full trees (maximum depth in all branches).
- Parameters:
max_depth (int)
- max_depth
- initialize(problem, representation, random, target_size, **kwargs)
- Parameters:
problem (geneticengine.problems.Problem)
representation (geneticengine.representations.api.Representation)
target_size (int)
- Return type:
Iterator[geneticengine.solutions.individual.PhenotypicIndividual]
- class geneticengine.representations.tree.operators.GrowInitializer
Bases:
geneticengine.algorithms.gp.structure.PopulationInitializerAll individuals are created expanding productions until a maximum depth, but without the requirement of reaching that depth.
- initialize(problem, representation, random, target_size, max_tries=1000, **kwargs)
- Parameters:
problem (geneticengine.problems.Problem)
representation (geneticengine.representations.api.Representation)
target_size (int)
max_tries (int)
- Return type:
Iterator[geneticengine.solutions.individual.PhenotypicIndividual]
- class geneticengine.representations.tree.operators.PositionIndependentGrowInitializer(max_depth)
Bases:
geneticengine.algorithms.gp.structure.PopulationInitializerAll individuals are created expanding productions until a maximum depth, but without the requirement of reaching that depth.
- Parameters:
max_depth (int)
- max_depth
- grow
- full
- initialize(problem, representation, random, target_size, **kwargs)
- Parameters:
problem (geneticengine.problems.Problem)
representation (geneticengine.representations.api.Representation)
target_size (int)
- Return type:
Iterator[geneticengine.solutions.individual.PhenotypicIndividual]
- class geneticengine.representations.tree.operators.RampedHalfAndHalfInitializer(max_depth)
Bases:
geneticengine.algorithms.gp.structure.PopulationInitializerHalf of the individuals are created with the maximum depth, and the other half with different values of maximum depth between the minimum and the maximum.
There’s an equal chance of using full or grow method.
- Parameters:
max_depth (int)
- max_depth
- initialize(problem, representation, random, target_size)
- Parameters:
problem (geneticengine.problems.Problem)
representation (geneticengine.representations.api.Representation)
target_size (int)
- Return type:
Iterator[geneticengine.solutions.individual.PhenotypicIndividual]
- class geneticengine.representations.tree.operators.InjectInitialPopulationWrapper(programs, backup)
Bases:
geneticengine.algorithms.gp.structure.PopulationInitializerStarts with an initial population, and relies on another initializer if it’s necessary to fulfill the population size.
- Parameters:
- programs
- backup_initializer
- initialize(problem, representation, random, target_size)
- Parameters:
problem (geneticengine.problems.Problem)
representation (geneticengine.representations.api.Representation)
target_size (int)
- Return type:
Iterator[geneticengine.solutions.individual.PhenotypicIndividual]