Skip to content

Commit d62f39f

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent c9c9639 commit d62f39f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

genetic_algorithm/genetic_algorithm_optimization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def initialize_population(self) -> list[np.ndarray]:
5454
... )
5555
>>> len(ga.initialize_population())
5656
5 # The population size should be equal to 5.
57-
>>> all(len(ind) == 2 for ind in ga.initialize_population())
57+
>>> all(len(ind) == 2 for ind in ga.initialize_population())
5858
# Each individual should have 2 variables
5959
True
6060
"""
@@ -134,7 +134,7 @@ def crossover(
134134
parent2 (np.ndarray): The second parent.
135135
Returns:
136136
tuple[np.ndarray, np.ndarray]: The two offspring generated by crossover.
137-
137+
138138
Example:
139139
>>> ga = GeneticAlgorithm(
140140
... lambda x, y: -(x**2 + y**2),
@@ -276,7 +276,7 @@ def target_function(var_x: float, var_y: float) -> float:
276276
var_y (float): The y-coordinate.
277277
Returns:
278278
float: The value of the function at (var_x, var_y).
279-
279+
280280
Example:
281281
>>> target_function(0, 0)
282282
0

0 commit comments

Comments
 (0)