From 9aff3e3e06b85da42abc4ac8d2780d497d3b3c10 Mon Sep 17 00:00:00 2001 From: coolneng Date: Mon, 17 May 2021 21:49:20 +0200 Subject: [PATCH] Rename get_first_random_solution function --- src/genetic_algorithm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/genetic_algorithm.py b/src/genetic_algorithm.py index 5c96427..90f68fe 100644 --- a/src/genetic_algorithm.py +++ b/src/genetic_algorithm.py @@ -2,7 +2,7 @@ from numpy import put, sum, append, where, zeros from numpy.random import choice, seed -def get_first_random_solution(n, m): +def generate_first_solution(n, m): seed(42) solution = zeros(shape=n, dtype=bool) random_indices = choice(n, size=m, replace=False) @@ -63,7 +63,7 @@ def explore_neighbourhood(element, data, max_iterations=100000): def genetic_algorithm(n, m, data): - first_solution = get_first_random_solution(n=n, m=m) + first_solution = generate_first_solution(n=n, m=m) best_solution = explore_neighbourhood( element=first_solution, data=data, max_iterations=100 )