Module: EvoSynth::Mutations::Functions

Defined in:
lib/evosynth/operators/mutations/flip_functions.rb

Overview

Contains all predefined flip functions to be used with the BinaryMutation, EfficientBinaryMutation and OneGeneFlipping mutation.

Constant Summary collapse

FLIP_BOOLEAN =

inverts a boolean value

lambda { |gene| !gene }
FLIP_BINARY =

inverts a integer in a boolean manner

lambda { |gene| gene == 0 ? 1 : 0 }
FLIP_NEGATE_NUMBER =

negates a integer

lambda { |gene| gene * -1 }