[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2024-11-15 09:01:01 +00:00
parent c9c9639803
commit d62f39f647

View File

@ -54,7 +54,7 @@ class GeneticAlgorithm:
... )
>>> len(ga.initialize_population())
5 # The population size should be equal to 5.
>>> all(len(ind) == 2 for ind in ga.initialize_population())
>>> all(len(ind) == 2 for ind in ga.initialize_population())
# Each individual should have 2 variables
True
"""
@ -134,7 +134,7 @@ class GeneticAlgorithm:
parent2 (np.ndarray): The second parent.
Returns:
tuple[np.ndarray, np.ndarray]: The two offspring generated by crossover.
Example:
>>> ga = GeneticAlgorithm(
... lambda x, y: -(x**2 + y**2),
@ -276,7 +276,7 @@ def target_function(var_x: float, var_y: float) -> float:
var_y (float): The y-coordinate.
Returns:
float: The value of the function at (var_x, var_y).
Example:
>>> target_function(0, 0)
0