So, I have the following class:
class GeneticAlgorithm():
def breed_population(self, agents, fitness=0.10, crossover_rate=0.50, mutation_rate=0.10, mutation_degree=0.10, mutate=True):
pass
def crossover(self, child, parent_one, parent_two, crossover_rate, mutation_rate, mutation_degree, mutate):
pass
When I try to run it, I get this error message:
agents = GeneticAlgorithm.breed_population(agents)
TypeError: breed_population() missing 1 required positional argument: 'agents'
Meaning that, for some reason, self is being treated like an actual argument instead of just giving the class access to all functions within the class.
How do I fix this?