From 42b78bcfea8a0bfb26a61d6c7f14ef55110d9c83 Mon Sep 17 00:00:00 2001 From: SimpleArt <71458112+SimpleArt@users.noreply.github.com> Date: Mon, 4 Jan 2021 22:59:17 -0500 Subject: [PATCH] Added self to parameters --- src/fitness_examples/Fitness_Examples.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fitness_examples/Fitness_Examples.py b/src/fitness_examples/Fitness_Examples.py index 4eb85a0..f79cc6c 100644 --- a/src/fitness_examples/Fitness_Examples.py +++ b/src/fitness_examples/Fitness_Examples.py @@ -1,4 +1,4 @@ -def is_it_5(chromosome): +def is_it_5(self, chromosome): """A very simple case test function - If the chromosome's gene value is equal to 5 add one to the chromosomes overall fitness value. """ @@ -15,7 +15,7 @@ def is_it_5(chromosome): return fitness -def near_5(chromosome): +def near_5(self, chromosome): """Test's the GA's ability to handle floats. Computes how close each gene is to 5.""" # Overall fitness value @@ -29,7 +29,7 @@ def near_5(chromosome): return fitness -def index_dependent_values(chromosome): +def index_dependent_values(self, chromosome): """Test of the GA's ability to improve fitness when the value is index-dependent. If a gene is equal to its index in the chromosome + 1, fitness is incremented. """