geneticengine.algorithms.gp.operators.combinators

Classes

IdentityStep

Returns the population that was presented to it

SequenceStep

Applies multiple steps in order, passing the output population of one

ParallelStep

Creates a new population, using different steps for different slices of

ExclusiveParallelStep

A version of ParallelStep, where each parallel step receives a portion

Module Contents

class geneticengine.algorithms.gp.operators.combinators.IdentityStep

Bases: geneticengine.algorithms.gp.structure.GeneticStep

Returns the population that was presented to it

iterate(problem, evaluator, representation, random, population, target_size, generation)
Parameters:
Return type:

Iterator[geneticengine.solutions.individual.PhenotypicIndividual]

class geneticengine.algorithms.gp.operators.combinators.SequenceStep(*steps)

Bases: geneticengine.algorithms.gp.structure.GeneticStep

Applies multiple steps in order, passing the output population of one step to the input population of the next step.

Parameters:

steps (geneticengine.algorithms.gp.structure.GeneticStep)

steps = ()
iterate(problem, evaluator, representation, random, population, target_size, generation)
Parameters:
Return type:

Iterator[geneticengine.solutions.individual.PhenotypicIndividual]

__str__()
class geneticengine.algorithms.gp.operators.combinators.ParallelStep(steps, weights=None)

Bases: geneticengine.algorithms.gp.structure.GeneticStep

Creates a new population, using different steps for different slices of the target population. The input population for each parallel step is always the complete input population. The output/target population is the one that is split across all of the slices. The size of each slice is given by the proportion of the weight of that particular weight, compared to the sum of all weights.

Consider the example:

another_step = ParallelStep([AStep(), BStep()], weights=[2,3])

In this example, the first 2/5 of the next population will be generated using AStep(), and the next 3/5 will be generated using BStep.

Parameters:
steps
weights
compute_ranges(population, target_size)

Computes the ranges for each slide, according to weights.

iterate(problem, evaluator, representation, random, population, target_size, generation)
Parameters:
Return type:

Iterator[geneticengine.solutions.individual.PhenotypicIndividual]

concat(ls)
cumsum(li)
__str__()
class geneticengine.algorithms.gp.operators.combinators.ExclusiveParallelStep(steps, weights=None)

Bases: ParallelStep

A version of ParallelStep, where each parallel step receives a portion of the input population equal to the target population of each slice.

Parameters:
iterate(problem, evaluator, representation, random, population, target_size, generation)
Parameters:
Return type:

Iterator[geneticengine.solutions.individual.PhenotypicIndividual]