Skip to content

Commit 5315bbe

Browse files
authored
Update sentence about keep_parents
This sentence is edited by Prof. Fernando Jiménez Barrionuevo (http://webs.um.es/fernan). Thank you! Dept. of Information and Communications Engineering Artificial Intelligence and Knowledge Engineering Group University of Murcia Campus de Espinardo, 30071-Espinardo, Murcia, Spain
1 parent 7f2b1f4 commit 5315bbe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pygad.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def __init__(self,
7070
gene_type: The type of the gene. It is assigned to any of these types (int, float, numpy.int, numpy.int8, numpy.int16, numpy.int32, numpy.int64, numpy.uint, numpy.uint8, numpy.uint16, numpy.uint32, numpy.uint64, numpy.float, numpy.float16, numpy.float32, numpy.float64) and forces all the genes to be of that type.
7171
7272
parent_selection_type: Type of parent selection.
73-
keep_parents: If 0, this means no parent in the current population will be used in the next population. If -1, this means all parents in the current population will be used in the next population. If set to a value > 0, then the specified value refers to the number of parents in the current population to be used in the next population. For some parent selection operators like rank selection, the parents are of high quality and it is beneficial to keep them in the next generation. In some other parent selection operators like roulette wheel selection (RWS), it is not guranteed that the parents will be of high quality and thus keeping the parents might degarde the quality of the population.
73+
keep_parents: If 0, this means no parent in the current population will be used in the next population. If -1, this means all parents in the current population will be used in the next population. If set to a value > 0, then the specified value refers to the number of parents in the current population to be used in the next population. Some parent selection operators such as rank selection, favor population diversity and therefore keeping the parents in the next generation can be beneficial. However, some other parent selection operators, such as roulette wheel selection (RWS), have higher selection pressure and keeping more than one parent in the next generation can seriously harm population diversity. Thanks to Prof. Fernando Jiménez Barrionuevo (http://webs.um.es/fernan) for editing this sentence.
7474
K_tournament: When the value of 'parent_selection_type' is 'tournament', the 'K_tournament' parameter specifies the number of solutions from which a parent is selected randomly.
7575
7676
crossover_type: Type of the crossover opreator. If crossover_type=None, then the crossover step is bypassed which means no crossover is applied and thus no offspring will be created in the next generations. The next generation will use the solutions in the current population.
@@ -3625,4 +3625,4 @@ def load(filename):
36253625
raise FileNotFoundError("Error reading the file {filename}. Please check your inputs.".format(filename=filename))
36263626
except:
36273627
raise BaseException("Error loading the file. If the file already exists, please reload all the functions previously used (e.g. fitness function).")
3628-
return ga_in
3628+
return ga_in

0 commit comments

Comments
 (0)