Perform crossovers, but do not allow decreases in organism fitness.
This doesn't actually do any crossover work, but instead relies on
another class to do the crossover and just checks that newly created
organisms do not have less fitness. This is useful for cases where
crossovers can
Methods
|
|
__init__
do_crossover
|
|
__init__
|
__init__ (
self,
actual_crossover,
accept_less=0.0,
)
Initialize to do safe crossovers.
Arguments:
actual_crossover - A Crossover class which actually implements
crossover functionality.
accept_less - A probability to accept crossovers which
generate less fitness. This allows you to accept some
crossovers which reduce fitness, but not all of them.
|
|
do_crossover
|
do_crossover (
self,
org_1,
org_2,
)
Perform a safe crossover between the two organism.
|
|