geneticengine.algorithms.gp.operators.combinators

Module Contents

Classes

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

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)

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

Iterator[geneticengine.solutions.individual.Individual]

__str__()

Return str(self).

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:
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.Individual]

concat(ls)
cumsum(li)
__str__()

Return str(self).

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.Individual]