8000 Test fitness batch calculation · madprog/GeneticAlgorithmPython@28fa28e · GitHub
[go: up one dir, main page]

Skip to content

Commit 28fa28e

Browse files
committed
Test fitness batch calculation
1 parent 99fd037 commit 28fa28e

File tree

2 files changed

+221
-41
lines changed

2 files changed

+221
-41
lines changed

tests/test_lifecycle_callbacks_calls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pygad
2+
import random
23

34
num_generations = 100
45

@@ -9,7 +10,7 @@ def number_lifecycle_callback_functions_calls(stop_criteria=None,
910
actual_num_callbacks_calls = 0
1011

1112
def fitness_func(ga_instanse, solution, solution_idx):
12-
return 1
13+
return random.random()
1314

1415
def on_start(ga_instance):
1516
nonlocal actual_num_callbacks_calls

0 commit comments

Comments
 (0)
0