Genetic-Algorithm-for-Job-Shop-Scheduling-and-NSGA-II icon indicating copy to clipboard operation
Genetic-Algorithm-for-Job-Shop-Scheduling-and-NSGA-II copied to clipboard

"break" in selection section

Open CHI-MING-LEE opened this issue 7 years ago • 1 comments

Hi,

Thank you for your excellent work! However, it seemed that there was a mistake in the selection section.

 if selection_rand[i]<=qk[0]:
            population_list[i][:]=total_chromosome[0][:]
            break  # <- the break was weird
        else:
            for j in range(0,population_size*2-1):
                if selection_rand[i]>qk[j] and selection_rand[i]<=qk[j+1]:
                    population_list[i][:]=total_chromosome[j+1][:]
                    break  # -> should be moved here?

CHI-MING-LEE avatar Jul 23 '18 07:07 CHI-MING-LEE

Oh! There was indeed a mistake. Thanks for your reminder. I have revised the code. Thanks

wurmen avatar Jul 25 '18 12:07 wurmen