macop.operators.continuous.mutators¶
Mutation implementations for continuous solution
-
class
macop.operators.continuous.mutators.
PolynomialMutation
(interval)[source]¶ Bases:
macop.operators.base.Mutation
Polynomial Mutation implementation for continuous solution
-
kind
¶ {
KindOperator
} – specify the kind of operator
Example:
>>> # import of solution and polynomial mutation operator >>> from macop.solutions.continuous import ContinuousSolution >>> from macop.operators.continuous.mutators import PolynomialMutation >>> solution = ContinuousSolution.random(5, (-2, 2)) >>> list(solution.data) [-0.50183952461055, 1.8028572256396647, 0.9279757672456204, 0.3946339367881464, -1.375925438230254] >>> mutator = PolynomialMutation(interval=(-2, 2)) >>> mutation_solution = mutator.apply(solution) >>> list(mutation_solution.data) [-0.50183952461055, 1.8028572256396647, 0.9279757672456204, 0.3946339367881464, -1.375925438230254]
-