Package Bio :: Package GA :: Package Mutation :: Module General :: Class SafeFitnessMutation
[hide private]
[frames] | no frames]

Class SafeFitnessMutation

source code

object --+
         |
        SafeFitnessMutation

Perform mutations, but do not allow decreases in organism fitness.

This doesn't actually do any mutation work, but just checks that
newly create organisms do not have lower fitnesses.

Instance Methods [hide private]
 
__init__(self, actual_mutation, accept_less=0.0)
Initialize to do safe mutations
source code
 
mutate(self, org)
Perform safe mutation of the specified organism.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, actual_mutation, accept_less=0.0)
(Constructor)

source code 
Initialize to do safe mutations

Arguments:

o actual_mutation - A Mutation class which actually implements
mutation. functionality.

o accept_less - A probability to accept mutations which
generate lower fitness. This allows you to accept some
crossovers which reduce fitness, but not all of them.

Overrides: object.__init__