Closed nibelungvalesti closed 5 years ago
I have the same problem. I think random_climb
, random_hill_climb
, and simulated_annealing
should use get_fitness
instead. genetic_alg
and mimic
still uses get_pop_fitness
as implemented.
get_fitness
returns the fitness value of the current state.
get_pop_fitness
returns the fitness values of the states of the current population. "Population" is only relevant in mimic
and genetic_alg
, I believe.
I'll make a quick fix to see how that goes.
random_climb? or hill_climb? I think hill_climb should have implemented it correctly from what I see? And yeah, SA should be updated with the same fix. Oh and I also made a pull request so you can check it with that fork. I verified that it works...so far!
Yeah, you're right. hill_climb
had it correct already.
Ahh I also made the same PR. 😄 I'll close mine.
I have just merged @nibelungvalesti 's pull request that fixes this issue, so am closing this. Thanks to @nibelungvalesti and @daivinhtran for pointing it out. Regards, Genevieve.
I think the fitness_curve.append in line 210 of algorithms.py is using the incorrect get_fitness (it's using get_pop_fitness)? When running an RHC, I get a blank array back for the fitness curve.