File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -174,18 +174,19 @@ def unique_int_gene_from_range(self,
174174 step = 1 ):
175175
176176 """
177- Finds a unique integer value for the gene.
178-
179- solution: A solution with duplicate values.
180- gene_index: Index of the gene to find a unique value.
181- min_val: Minimum value of the range to sample a number randomly.
182- max_val: Maximum value of the range to sample a number randomly.
183- mutation_by_replacement: Identical to the self.mutation_by_replacement attribute.
184- gene_type: Exactly the same as the self.gene_type attribute.
185- step: Defaults to 1.
177+ Finds a unique integer value for a specific gene in a solution.
178+
179+ Args:
180+ solution (list): A solution containing genes, potentially with duplicate values.
181+ gene_index (int): The index of the gene for which to find a unique value.
182+ min_val (int): The minimum value of the range to sample a number randomly.
183+ max_val (int): The maximum value of the range to sample a number randomly.
184+ mutation_by_replacement (bool): Indicates if mutation is performed by replacement.
185+ gene_type (type): The data type of the gene (e.g., int, float).
186+ step (int, optional): The step size for generating candidate values. Defaults to 1.
186187
187188 Returns:
188- selected_value : The new value of the gene. It may be identical to the original gene value in case there are no possible unique values for the gene .
189+ int : The new value of the gene. If no unique value can be found, the original gene value is returned .
189190 """
190191
191192 # The gene_type is of the form [type, precision]
You can’t perform that action at this time.
0 commit comments