GeneticAlgorithmPython icon indicating copy to clipboard operation
GeneticAlgorithmPython copied to clipboard

GA.run_completed attribute initializer missing

Open FeBe95 opened this issue 1 year ago • 1 comments

I can't check ga_instance.run_completed == False during runtime because ga_instance.run_completed is initialized to True only after a finished run. It was never initialized to False inside of class GA. This line is missing from pygad.py I suppose (lines 911 - 941):

self.run_completed = False

Workaround for now in example.py:

ga_instance = pygad.GA(
  # [...]
)

ga_instance.run_completed = False

FeBe95 avatar Jul 30 '22 20:07 FeBe95

Thanks @FeBe95 for your suggestion. This is definitely a good thing to support.

In the next release, the run_completed property will be initialized to False.

ahmedfgad avatar Aug 02 '22 15:08 ahmedfgad