From fe7ae3c54cbec912389798daff748d73040217a9 Mon Sep 17 00:00:00 2001 From: Kappes Marques Rodrigo <rodrigo.kappes@student-cs.fr> Date: Thu, 30 Jan 2020 09:09:18 +0100 Subject: [PATCH] cleaned the algogenetique --- algogenetique.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/algogenetique.py b/algogenetique.py index 238066d..42156ac 100644 --- a/algogenetique.py +++ b/algogenetique.py @@ -24,7 +24,7 @@ def main(N,tmax,pmutation, proportion): #Creation of the initial population People=Population(N) - #Avaliating the initial population + #Evaluating the initial population for the histogram S1=[] for individu in People.indiv: individu.evaluate() @@ -55,6 +55,7 @@ def main(N,tmax,pmutation, proportion): plt.subplot(221) plt.plot([i for i in range(tmax)], L) + #Graph of the original population plt.subplot(223) plt.hist(S1, range = (0, maximum+10), bins = 20, color = 'red') @@ -63,6 +64,7 @@ def main(N,tmax,pmutation, proportion): print("Distance finale: ", best.distance) print("Avg:", sum(S2)/len(S2)) + #Graph of the final population plt.subplot(224) plt.hist(S2, range = (0,maximum+10), bins = 20, color = 'blue') plt.show() -- GitLab